mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-01-11 02:30:01 +01:00
Add item for page 362
This commit is contained in:
parent
bd844753f8
commit
1752ec5c6c
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
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** (30 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** (7 items)](improvements.md): Changes to text or code that would improve the content. These are optional.
|
||||
[**Improvements** (8 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.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
**Errata** (30 items)
|
||||
**Errata** (31 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.
|
||||
|
||||
|
|
@ -26,6 +26,7 @@ If you find any mistakes, then please [raise an issue in this repository](https:
|
|||
- [Page 322 - Revealing the location of a type](#page-322---revealing-the-location-of-a-type)
|
||||
- [Page 330 - Publishing a self-contained app, Page 354 - Exercise 7.3 – Explore PowerShell](#page-330---publishing-a-self-contained-app-page-354---exercise-73--explore-powershell)
|
||||
- [Page 399 - Managing directories](#page-399---managing-directories)
|
||||
- [Page 362 - Joining, formatting, and other string members](#page-362---joining-formatting-and-other-string-members)
|
||||
- [Page 412 - Compressing streams](#page-412---compressing-streams)
|
||||
- [Page 477 - Inserting entities](#page-477---inserting-entities)
|
||||
- [Page 548 - Creating a class library for a Northwind database context](#page-548---creating-a-class-library-for-a-northwind-database-context)
|
||||
|
|
@ -281,6 +282,10 @@ In Step 1, in the second bullet, I wrote, "Check for the existence of the custom
|
|||
|
||||
> Note: the `Path.Exists` method was added in .NET 7. It is not available in earlier versions of .NET.
|
||||
|
||||
# Page 362 - Joining, formatting, and other string members
|
||||
|
||||
In the table, `string.IsNullOrWhitespace` should be `string.IsNullOrWhiteSpace`.
|
||||
|
||||
# Page 412 - Compressing streams
|
||||
|
||||
> Thanks to Bob Molloy for raising this issue via email.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
**Improvements** (7 items)
|
||||
**Improvements** (8 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.
|
||||
|
||||
- [Page 86 - Getting text input from the user](#page-86---getting-text-input-from-the-user)
|
||||
- [Page 128 - Rounding numbers](#page-128---rounding-numbers)
|
||||
- [Page 153 - Writing a function that returns a value](#page-153---writing-a-function-that-returns-a-value)
|
||||
- [Page 179 - Reviewing project packages](#page-179---reviewing-project-packages)
|
||||
|
|
@ -10,6 +11,12 @@ 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 655 - Exercise 14.2 – Practice implementing MVC by implementing a category detail page](#page-655---exercise-142--practice-implementing-mvc-by-implementing-a-category-detail-page)
|
||||
|
||||
# Page 86 - Getting text input from the user
|
||||
|
||||
In Step 1, I note that the `ReadLine` method is declared to return `string?`, meaning that it could return a `null` value instead of a `string` value (including an empty one). I also note that this is treated as a warning by the compiler.
|
||||
|
||||
In the next edition, I will add a note to explain that this method never actually returns `null` so there is no point in checking for that in functional code. A more useful check is `string.IsNullOrEmpty` so I will add more steps to show how to use that method and `string.IsNullOrWhiteSpace` to validate text input.
|
||||
|
||||
# Page 128 - Rounding numbers
|
||||
|
||||
In this section, I wrote about rounding rules as taught in schools and compare them to rounding rules when using C# and .NET. In schools, children are introduced to rounding rules with positive numbers and so learn the term "rounding up" and "rounding down". I did not explicitly say that for negative numbers, those terms would be reversed which can be confusing, so those terms should be avoided. This is why the .NET API uses the enum values `AwayFromZero`, `ToZero`, `ToEven`, `ToPositiveInfinity` and `ToNegativeInfinity` for improved clarity. In the next edition I will add a note about this.
|
||||
|
|
|
|||
Loading…
Reference in a new issue