1.7 KiB
Improvements (2 items)
If you have suggestions for improvements, then please raise an issue in this repository or email me at markjprice (at) gmail.com.
- Page 153 - Writing a function that returns a value
- Page 453 - Scaffolding models using an existing database
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.
Add the following statement near the top of the code file before doing any writing to the console:
Console.OutputEncoding = System.Text.Encoding.UTF8;
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:
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.