diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index 33e0ffd..3e5cc51 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -132,17 +132,27 @@ In this section, I introduce the various technologies like Razor Pages, MVC, and In the next edition, I will add a section with a table summarizing the file types used by these technologies because they are similar but different and if the reader does not understand some subtle but important differences, it can cause much confusion when trying to implement their own projects. -|Technology|File extension|Directive| -|---|---|---| -|Razor View (for MVC)|`.cshtml`|None| -|Razor Page|`.cshtml`|`@page`| -|Razor Component (for Blazor)|`.razor`|None| -|Razor Page Component (for Blazor)|`.razor`|`@page`| +|Technology|Special filename|File extension|Directive| +|---|---|---|---| +|Razor View (for MVC)||`.cshtml`|None| +|Razor Page||`.cshtml`|`@page`| +|Razor Component (for Blazor)||`.razor`|None| +|Razor Component (for Blazor with page routing)||`.razor`|`@page`| +|Razor Layout||`.cshtml`|None| +|Razor View Start|`_ViewStart`|`.cshtml`|None| +|Razor View Imports|`_ViewImports`|`.cshtml`|None| > **Warning!** Be careful to use the correct file extension and directive at the top of the file or you will get unexpected behavior. ![Visual Studio 2022 Razor project item types](images/razor-file-types.png) +A **Razor Layout** file like `_MyCustomLayout.cshtml` is identical to a **Razor View**. What makes it a layout is being set as the `Layout` property of another Razor file, as shown in the following code: +```cs +@{ + Layout = "_MyCustomLayout"; +} +``` + # Page 547 - Creating a class library for a Northwind database context In Step 8, you write code to implement the `OnConfiguring` method so that it sets the Filename path to the SQLite database file correctly when running in both Visual Studio 2022 and at the command-line with Visual Studio Code, as shown in the following code: