Skip to content

Commit d266d77

Browse files
Copilotwadepickett
andauthored
Fix VS Code tab step ordering: configure DbContext before scaffolding in 8.0 tutorial (#36958)
* Initial plan * Fix VS Code tab step ordering: configure DbContext before scaffolding Move "Use SQLite for development, SQL Server for production" subsection before the scaffolding command in the Visual Studio Code tab of adding-model8.md so readers configure Program.cs before running dotnet aspnet-codegenerator. Agent-Logs-Url: https://github.com/dotnet/AspNetCore.Docs/sessions/cc710fc5-8af0-434e-b488-c136227d4a33 Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> * Fix punctuation and formatting in adding-model8.md Fxied a few typos. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> Co-authored-by: Wade Pickett <wpickett@microsoft.com>
1 parent 1683561 commit d266d77

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

aspnetcore/tutorials/first-mvc-app/adding-model/includes/adding-model8.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ These model classes are used with [Entity Framework Core](/ef/core) (EF Core) to
66

77
The model classes created are known as ***POCO*** classes, from **P**lain **O**ld **C**LR **O**bjects. POCO classes don't have any dependency on EF Core. They only define the properties of the data to be stored in the database.
88

9-
In this tutorial, model classes are created first, and EF Core creates the database.
9+
In this tutorial, model classes are created first, and EF Core creates the database.
1010

1111
## Add a data model class
1212

@@ -66,7 +66,7 @@ In **Solution Explorer**, right-click the *Controllers* folder and select **Add
6666
In the **Add New Scaffolded Item** dialog:
6767

6868
* In the left pane, select **Installed** > **Common** > **MVC**.
69-
* Select **MVC Controller with views, using Entity Framework**.
69+
* Select **MVC Controller with views, using Entity Framework**.
7070
* Select **Add**.
7171

7272
![Add Scaffold dialog](~/tutorials/first-mvc-app/adding-model/_static/8/add_scaffold-VS22-17.8.0.png)
@@ -115,6 +115,14 @@ Build the app to verify that there are no errors.
115115

116116
Open a command window in the project directory. The project directory is the directory that contains the `Program.cs` and `.csproj` files.
117117

118+
<a name="sqlite-dev-vsc"></a>
119+
120+
### Use SQLite for development, SQL Server for production
121+
122+
The following highlighted code in `Program.cs` shows how to use SQLite in development and SQL Server in production.
123+
124+
[!code-csharp[](~/tutorials/first-mvc-app/start-mvc/sample/MvcMovie80/Program.cs?name=snippet_SQLiteDevProd&highlight=3-99)]
125+
118126
On macOS and Linux, export the scaffold tool path:
119127

120128
```console
@@ -139,7 +147,7 @@ Scaffolding creates the following:
139147

140148
Scaffolding updates the following:
141149

142-
* Registers the database context in the `Program.cs` file
150+
* Registers the database context in the `Program.cs` file.
143151
* Adds a database connection string to the `appsettings.json` file.
144152

145153
The automatic creation of these files and file updates is known as *scaffolding*.
@@ -148,14 +156,6 @@ The scaffolded pages can't be used yet because the database doesn't exist. Runni
148156

149157
Build the app to verify that there are no errors.
150158

151-
<a name="sqlite-dev-vsc"></a>
152-
153-
### Use SQLite for development, SQL Server for production
154-
155-
The following highlighted code in `Program.cs` shows how to use SQLite in development and SQL Server in production.
156-
157-
[!code-csharp[](~/tutorials/first-mvc-app/start-mvc/sample/MvcMovie80/Program.cs?name=snippet_SQLiteDevProd&highlight=3-99)]
158-
159159
---
160160

161161
<a name="migration"></a>
@@ -388,4 +388,4 @@ Because the `Model` object is strongly typed as an `IEnumerable<Movie>` object,
388388
> [Previous: Adding a View](~/tutorials/first-mvc-app/adding-view.md)
389389
> [Next: Working with SQL](~/tutorials/first-mvc-app/working-with-sql.md)
390390
391-
:::moniker-end
391+
:::moniker-end

0 commit comments

Comments
 (0)