From 1ed9843189db9aaf88dc78009766037e08584c80 Mon Sep 17 00:00:00 2001 From: Tom Dykstra Date: Tue, 31 Aug 2021 17:23:02 -0700 Subject: [PATCH] Minor fixes and clarifications (#23177) * Update razor-pages-start.md * Update model.md * Update model.md * Update sql.md * Update model.md * Update model.md * Update model.md --- aspnetcore/tutorials/razor-pages/model.md | 4 +++- aspnetcore/tutorials/razor-pages/razor-pages-start.md | 5 ++--- aspnetcore/tutorials/razor-pages/sql.md | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/aspnetcore/tutorials/razor-pages/model.md b/aspnetcore/tutorials/razor-pages/model.md index c0270f8239..b96ee85270 100644 --- a/aspnetcore/tutorials/razor-pages/model.md +++ b/aspnetcore/tutorials/razor-pages/model.md @@ -784,6 +784,8 @@ In this section, the movie model is scaffolded. That is, the scaffolding tool pr 1. Select **Add**. ![Add Razor Pages](model/_static/3/arp.png) + + If you get an error message that says you need to install the `Microsoft.EntityFrameworkCore.SqlServer` package, repeat the steps starting with **Add** > **New Scaffolded Item**. The *appsettings.json* file is updated with the connection string used to connect to a local database. @@ -968,7 +970,7 @@ An alternative approach is to disable the CS8618 [warning with pragma](/dotnet/f [!code-csharp[](~/tutorials/razor-pages/razor-pages-start/sample/RazorPagesMovie60/Data/RazorPagesMovieContext.cs?name=snippet_prag)] -For the warnings in the Razor Pages C# code behind files, use the [pragma](/dotnet/csharp/language-reference/preprocessor-directives#pragmas) C# preprocessor directive is disable warnings. For example, use the following highlighted code in the *Pages/Movies/Index.cshtml.cs* file: +For the warnings in the Razor Pages C# code behind files, use the [pragma](/dotnet/csharp/language-reference/preprocessor-directives#pragmas) C# preprocessor directive to disable warnings. For example, use the following highlighted code in the *Pages/Movies/Index.cshtml.cs* file: [!code-csharp[](~/tutorials/razor-pages/razor-pages-start/snapshot_sample6/Pages/Movies/Index.cshtml.cs?name=snippet&highlight=3-4,21,22)] diff --git a/aspnetcore/tutorials/razor-pages/razor-pages-start.md b/aspnetcore/tutorials/razor-pages/razor-pages-start.md index 391358bbbf..e0f1c2bc85 100644 --- a/aspnetcore/tutorials/razor-pages/razor-pages-start.md +++ b/aspnetcore/tutorials/razor-pages/razor-pages-start.md @@ -417,7 +417,7 @@ We hope to have Visual Studio for Mac instructions soon. -Press Ctrl+F5 to run without the debugger. +Select **RazorPagesMovie** in **Solution Explorer**, and then press Ctrl+F5 to run without the debugger. Visual Studio displays the following dialog when a project is not yet configured to use SSL: @@ -505,8 +505,7 @@ The following code enables various [Middleware](xref:fundamentals/middleware/ind * `app.UseRouting();` : Adds route matching to the middleware pipeline. For more information, see * `app.MapRazorPages();`: Configures endpoint routing for Razor Pages. * `app.UseAuthorization();` : Authorizes a user to access secure resources. This app doesn't use authorization, therefore this line could be removed. - -`app.Run();` : runs the app. +* `app.Run();` : Runs the app. ## Troubleshooting with the completed sample diff --git a/aspnetcore/tutorials/razor-pages/sql.md b/aspnetcore/tutorials/razor-pages/sql.md index 68916543d4..f624ba4ff5 100644 --- a/aspnetcore/tutorials/razor-pages/sql.md +++ b/aspnetcore/tutorials/razor-pages/sql.md @@ -427,6 +427,12 @@ Update the *Program.cs* with the following highlighted code: [!code-csharp[](~/tutorials/razor-pages/razor-pages-start/sample/RazorPagesMovie60/ProgramSeed.cs?name=snippet_all&highlight=14-19)] +Add a `using` directive to the top of the file: + +```csharp +using RazorPagesMovie.Models; +``` + # [Visual Studio Code / Visual Studio for Mac](#tab/visual-studio-code+visual-studio-mac) [!code-csharp[](~/tutorials/razor-pages/razor-pages-start/sample/RazorPagesMovie60/ProgramSeed.cs?name=snippet_all_sl&highlight=14-19)]