mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
Added item for page 533
This commit is contained in:
parent
9a5989ca75
commit
1ef7ca410b
|
|
@ -4,6 +4,6 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros
|
||||||
|
|
||||||
[**Errata** (31 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build.
|
[**Errata** (31 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build.
|
||||||
|
|
||||||
[**Improvements** (13 items)](improvements.md): Changes to text or code that would improve the content. These are optional.
|
[**Improvements** (14 items)](improvements.md): Changes to text or code that would improve the content. These are optional.
|
||||||
|
|
||||||
All errata and improvements will be included in the 8th edition planned for publishing in November 2023. To be included they must be submitted by mid-September 2023.
|
All errata and improvements will be included in the 8th edition planned for publishing in November 2023. To be included they must be submitted by mid-September 2023.
|
||||||
|
|
|
||||||
BIN
docs/errata/images/razor-file-types.png
Normal file
BIN
docs/errata/images/razor-file-types.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
**Improvements** (13 items)
|
**Improvements** (14 items)
|
||||||
|
|
||||||
If you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com.
|
If you have suggestions for improvements, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com.
|
||||||
|
|
||||||
|
|
@ -9,6 +9,7 @@ If you have suggestions for improvements, then please [raise an issue in this re
|
||||||
- [Page 251 - Setting up a class library and console application](#page-251---setting-up-a-class-library-and-console-application)
|
- [Page 251 - Setting up a class library and console application](#page-251---setting-up-a-class-library-and-console-application)
|
||||||
- [Page 299 - Treating warnings as errors](#page-299---treating-warnings-as-errors)
|
- [Page 299 - Treating warnings as errors](#page-299---treating-warnings-as-errors)
|
||||||
- [Page 453 - Scaffolding models using an existing database](#page-453---scaffolding-models-using-an-existing-database)
|
- [Page 453 - Scaffolding models using an existing database](#page-453---scaffolding-models-using-an-existing-database)
|
||||||
|
- [Page 533 - Building websites using ASP.NET Core](#page-533---building-websites-using-aspnet-core)
|
||||||
- [Page 547 - Creating a class library for a Northwind database context](#page-547---creating-a-class-library-for-a-northwind-database-context)
|
- [Page 547 - Creating a class library for a Northwind database context](#page-547---creating-a-class-library-for-a-northwind-database-context)
|
||||||
- [Page 551 - Creating a class library for entity models using SQL Server](#page-551---creating-a-class-library-for-entity-models-using-sql-server)
|
- [Page 551 - Creating a class library for entity models using SQL Server](#page-551---creating-a-class-library-for-entity-models-using-sql-server)
|
||||||
- [Page 573 - Adding code to a Razor Page](#page-573---adding-code-to-a-razor-page)
|
- [Page 573 - Adding code to a Razor Page](#page-573---adding-code-to-a-razor-page)
|
||||||
|
|
@ -125,6 +126,23 @@ For convenience, here is the same command as a single line to make it easier to
|
||||||
dotnet ef dbcontext scaffold "Filename=Northwind.db" Microsoft.EntityFrameworkCore.Sqlite --table Categories --table Products --output-dir AutoGenModels --namespace WorkingWithEFCore.AutoGen --data-annotations --context Northwind
|
dotnet ef dbcontext scaffold "Filename=Northwind.db" Microsoft.EntityFrameworkCore.Sqlite --table Categories --table Products --output-dir AutoGenModels --namespace WorkingWithEFCore.AutoGen --data-annotations --context Northwind
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Page 533 - Building websites using ASP.NET Core
|
||||||
|
|
||||||
|
In this section, I introduce the various technologies like Razor Pages, MVC, and Blazor that are included with ASP.NET Core.
|
||||||
|
|
||||||
|
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`|
|
||||||
|
|
||||||
|
> **Warning!** Be careful to use the correct file extension and directive at the top of the file or you will get unexpected behavior.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# Page 547 - Creating a class library for a Northwind database context
|
# 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:
|
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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue