diff --git a/docs/errata/README.md b/docs/errata/README.md index 60e53ec..cc75a01 100644 --- a/docs/errata/README.md +++ b/docs/errata/README.md @@ -4,6 +4,6 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros [**Errata** (35 items)](errata.md): Typos, tool user interface changes, or mistakes in code that would cause a compilation error that prevents a successful build. -[**Improvements** (25 items)](improvements.md): Changes to text or code that would improve the content. These are optional. +[**Improvements** (26 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. diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index c61f84c..30af89a 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -1,4 +1,4 @@ -**Improvements** (25 items) +**Improvements** (26 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. @@ -17,6 +17,7 @@ If you have suggestions for improvements, then please [raise an issue in this re - [Page 299 - Treating warnings as errors](#page-299---treating-warnings-as-errors) - [Page 339 - Viewing source links with Visual Studio 2022](#page-339---viewing-source-links-with-visual-studio-2022) - [Page 343 - Packaging a library for NuGet](#page-343---packaging-a-library-for-nuget) +- [Page 351 - Using non-.NET Standard libraries](#page-351---using-non-net-standard-libraries) - [Page 444 - Connecting to a database](#page-444---connecting-to-a-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) @@ -333,6 +334,36 @@ In the next edition, I will add a warning about this and include a reference to https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target +# Page 351 - Using non-.NET Standard libraries + +> Thanks to [Masoud Nazari](https://github.com/MAS-OUD) for raising this [issue on 24 March 2023](https://github.com/markjprice/cs11dotnet7/issues/49). + +In Step 4, the code sets the `Label` of instances of `Axis` and `Matrix` using the concatenate operator `+`, as shown in the following code: +```cs +for (int i = 0; i < matrix.Axes[0].Points.Length; i++) +{ + matrix.Axes[0].Points[i].Label = "x" + i.ToString(); +} + +for (int i = 0; i < matrix.Axes[1].Points.Length; i++) +{ + matrix.Axes[1].Points[i].Label = "y" + i.ToString(); +} +``` + +It would be an improvement if the expressions used interpolated strings, as shown in the following code: +```cs +for (int i = 0; i < matrix.Axes[0].Points.Length; i++) +{ + matrix.Axes[0].Points[i].Label = $"x{i}"; +} + +for (int i = 0; i < matrix.Axes[1].Points.Length; i++) +{ + matrix.Axes[1].Points[i].Label = $"y{i}"; +} +``` + # Page 444 - Connecting to a database I wrote, "To connect to a SQLite database, we just need to know the database filename, set using the parameter `Filename`."