From 527517c884a71ba138f5503c7b085d1866b9ae45 Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Sat, 7 Jan 2023 09:56:14 +0000 Subject: [PATCH] Add item for page 453 --- docs/errata/improvements.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index 702b82b..ef2f364 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -1,14 +1,11 @@ -**Improvements** (1 item) +**Improvements** (2 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. -- [Print Book](#print-book) - - [Page 153 - Writing a function that returns a value](#page-153---writing-a-function-that-returns-a-value) -- [Bonus Content](#bonus-content) +- [Page 153 - Writing a function that returns a value](#page-153---writing-a-function-that-returns-a-value) +- [Page 453 - Scaffolding models using an existing database](#page-453---scaffolding-models-using-an-existing-database) -# Print Book - -## Page 153 - Writing a function that returns a value +# Page 153 - Writing a function that returns a value At the end of this section there is a note box that explains that we could use the `C` format code to format the output as currency. If you are running on a computer in a culture that uses Euros then to show the Euro currency symbol you must enable UTF-8 encoding. @@ -18,6 +15,16 @@ Add the following statement near the top of the code file before doing any writi Console.OutputEncoding = System.Text.Encoding.UTF8; ``` -# Bonus Content +# Page 453 - Scaffolding models using an existing database -None so far. +In Step 2, I show text that must be entered as a single line at the command-line, as shown in the following command: +``` +dotnet ef dbcontext scaffold "Filename=Northwind.db" Microsoft. +EntityFrameworkCore.Sqlite --table Categories --table Products --output- +dir AutoGenModels --namespace WorkingWithEFCore.AutoGen --data- +annotations --context Northwind +``` + +I recommend that you copy and paste long commands like this from the eBook into a plain text editor like Notepad, and then make sure that the whole command is properly formatted as a single line, before you then copy and paste it to the command-line. + +Copying and pasting directly from the ebook is likely to include newline characters and missing spaces and so on that break the command.