Update adding-model.md (#3117)

pull/3118/head
Rick Anderson 2017-03-30 17:41:07 -10:00 committed by GitHub
parent 46652bc04f
commit bb2f2a01c6
1 changed files with 4 additions and 4 deletions

View File

@ -30,6 +30,10 @@ We've finally added a **M**odel to our **M**VC app.
[!code-csharp[Main](start-mvc/sample/MvcMovie/MvcMovie.csproj?highlight=5,15-)]
- Select **Restore** to the **Info** message "There are unresolved dependencies".
- Create a *Models/MvcMovieContext.cs* file and add the following `MvcMovieContext` class:
[!code-csharp[Main](start-mvc/sample/MvcMovie/Models/MvcMovieContext.cs)]
- Update the *Startup.cs* file and add two usings:
[!code-csharp[Main](start-mvc/sample/MvcMovie/Startup.cs?name=snippet1&highlight=1,2)]
@ -38,10 +42,6 @@ We've finally added a **M**odel to our **M**VC app.
[!code-csharp[Main](start-mvc/sample/MvcMovie/Startup.cs?name=snippet2&highlight=5-7)]
- Create a *Models/MvcMovieContext.cs* file and add the following `MvcMovieContext` class:
[!code-csharp[Main](start-mvc/sample/MvcMovie/Models/MvcMovieContext.cs)]
- Add a database connection string to the *appsettings.json* file:
[!code-csharp[Main](start-mvc/sample/MvcMovie/appsettings.json?highlight=7-)]