From bfd22d7c9fa763f5bbb97ccffcc615bb5b7db255 Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Tue, 11 Apr 2023 15:57:44 +0100 Subject: [PATCH] Added item for page 478 --- docs/errata/README.md | 2 +- docs/errata/errata.md | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/errata/README.md b/docs/errata/README.md index 62c931f..043032a 100644 --- a/docs/errata/README.md +++ b/docs/errata/README.md @@ -2,7 +2,7 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals*, or 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. -[**Errata** (40 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build. +[**Errata** (41 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build. [**Improvements** (29 items)](improvements.md): Changes to text or code that would improve the content. These are optional. diff --git a/docs/errata/errata.md b/docs/errata/errata.md index 26035a4..293ca1c 100644 --- a/docs/errata/errata.md +++ b/docs/errata/errata.md @@ -1,4 +1,4 @@ -**Errata** (40 items) +**Errata** (41 items) If you find any mistakes, then please [raise an issue in this repository](https://github.com/markjprice/cs11dotnet7/issues) or email me at markjprice (at) gmail.com. @@ -39,6 +39,7 @@ If you find any mistakes, then please [raise an issue in this repository](https: - [Category class changes](#category-class-changes) - [NorthwindDb class changes](#northwinddb-class-changes) - [Page 477 - Inserting entities](#page-477---inserting-entities) +- [Page 478 - Updating entities](#page-478---updating-entities) - [Page 548 - Creating a class library for a Northwind database context](#page-548---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) @@ -564,6 +565,20 @@ It should use the method signature that allows multiple `productIds` to be highl ListProducts(productIdsToHighlight: new[] { resultAdd.productId }); ``` +# Page 478 - Updating entities + +> Thanks to [Masoud](https://github.com/MAS-OUD) for raising this [issue on 11 April 2023](https://github.com/markjprice/cs11dotnet7/issues/57). + +In Step 2, the statement to output the price increase, as shown in the following code: +```cs +WriteLine("Increase price success for ID: {resultUpdate.productId}."); +``` + +Is missing the `$` prefix to make it an interpolated string, as shown in the following code: +```cs +WriteLine($"Increase price success for ID: {resultUpdate.productId}."); +``` + # Page 548 - Creating a class library for a Northwind database context In Step 11, you write an extension method that registers the `NorthwindContext` class for use as a dependency service. In later chapters, this will be used in ASP.NET Core and Blazor projects. By default, a `DbContext` class is registered using `Scope` lifetime, meaning that multiple threads can share the same instance. If more than one thread attempts to use the same `NorthwindContext` class instance at the same time then you will see the following runtime exception thrown: