mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-19 13:13:54 +00:00
Add item for page 299
This commit is contained in:
parent
e008287a1b
commit
91a6ce29e5
2 changed files with 13 additions and 2 deletions
|
|
@ -4,6 +4,6 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros
|
|||
|
||||
[**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.
|
||||
|
||||
[**Improvements** (6 items)](improvements.md): Changes to text or code that would improve the content. These are optional.
|
||||
[**Improvements** (7 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 @@
|
|||
**Improvements** (6 items)
|
||||
**Improvements** (7 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.
|
||||
|
||||
|
|
@ -6,6 +6,7 @@ If you have suggestions for improvements, then please [raise an issue in this re
|
|||
- [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)
|
||||
- [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 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)
|
||||
|
||||
|
|
@ -72,6 +73,16 @@ message saying that required assets are missing, click Yes to add them.
|
|||
Harry was born on a Sunday.
|
||||
```
|
||||
|
||||
# Page 299 - Treating warnings as errors
|
||||
|
||||
This section shows how to follow best practice and treat warnings as errors. But doing so means you must write extra code in common scenarios to fix all warnings that will now be treated as errors that prevent compilation during the build process.
|
||||
|
||||
So this section also shows how to disable some common warnings by adding extra code. The project is NOT designed to be run. The code in it is written only to illustrate some common warnings and how to disable them to allow a build.
|
||||
|
||||
For example, one warning is caused by the compiler thinking there could be a null dereference. To disable the warning, you therefore need to check for a `null` value *even though we know that can never actually happen* as explained in the note. That extra code check is pointless if you run the console app and expect it to work correctly.
|
||||
|
||||
In the next edition, I will add another note to explicitly tell the reader not to run the project. The project implementation is not written to actually function as a check if someone has entered their name because that's not the point of this section.
|
||||
|
||||
# Page 453 - Scaffolding models using an existing database
|
||||
|
||||
In Step 2, I show text that must be entered as a single line at the command-line, as shown in the following command formatted as in the print book:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue