From ed8ca3828aba25e0b75432b46d899b01efcbfd0f Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Wed, 14 Jun 2023 11:13:09 +0100 Subject: [PATCH] Add items for pages 541 and 550 --- docs/errata/README.md | 2 +- docs/errata/improvements.md | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/errata/README.md b/docs/errata/README.md index 822efbe..0aee850 100644 --- a/docs/errata/README.md +++ b/docs/errata/README.md @@ -4,7 +4,7 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros [**Errata** (44 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build. -[**Improvements** (39 items)](improvements.md): Changes to text or code that would improve the content. These are optional. +[**Improvements** (41 items)](improvements.md): Changes to text or code that would improve the content. These are optional. [**Common Errors** (6 items)](common-errors.md): These are some of the most common errors that a reader might encounter when trying to get code in book tasks to work, or when trying to write your own code. diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index 3a71d6b..4919bad 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -1,4 +1,4 @@ -**Improvements** (39 items) +**Improvements** (41 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. @@ -31,7 +31,9 @@ If you have suggestions for improvements, then please [raise an issue in this re - [Page 453 - Scaffolding models using an existing database](#page-453---scaffolding-models-using-an-existing-database) - [Page 512 - Group-joining sequences](#page-512---group-joining-sequences) - [Page 533 - Building websites using ASP.NET Core](#page-533---building-websites-using-aspnet-core) +- [Page 541 - Creating a class library for entity models using SQLite](#page-541---creating-a-class-library-for-entity-models-using-sqlite) - [Page 547 - Creating a class library for a Northwind database context](#page-547---creating-a-class-library-for-a-northwind-database-context) +- [Page 550 - Creating a class library for entity models using SQL Server](#page-550---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 586 - Creating a Razor class library, Page 587 - Implementing a partial view to show a single employee](#page-586---creating-a-razor-class-library-page-587---implementing-a-partial-view-to-show-a-single-employee) @@ -771,6 +773,15 @@ A **Razor Layout** file like `_MyCustomLayout.cshtml` is identical to a **Razor ![Visual Studio 2022 Razor project item types](images/razor-file-types.png) +# Page 541 - Creating a class library for entity models using SQLite + +In Step 9, you enter a `dotnet-ef` command. You must be in the project folder containing the `.csproj` file or you will see the following error: +``` +No project was found. Change the current working directory or use the --project option. +``` + +In the 8th edition, I will add a note about this. + # 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: @@ -873,6 +884,15 @@ public static IServiceCollection AddNorthwindContext( } ``` +# Page 550 - Creating a class library for entity models using SQL Server + +In Step 6, you enter a `dotnet-ef` command. You must be in the project folder containing the `.csproj` file or you will see the following error: +``` +No project was found. Change the current working directory or use the --project option. +``` + +In the 8th edition, I will add a note about this. + # Page 551 - Creating a class library for entity models using SQL Server In Step 14, I tell the reader, "In the `Northwind.Common.DataContext.SqlServer` project, in `NorthwindContext.cs`, remove