Closed donaldmaisey closed 3 months ago
Thanks! I started to make some changes to remove those two tables based on the following issue raised by another reader: https://github.com/markjprice/cs12dotnet8/issues/40. I added an improvement item here: https://github.com/markjprice/cs12dotnet8/blob/main/docs/errata/improvements.md#page-634---creating-the-northwind-database. But it's probably best if I keep the SQL script as it was originally for the 8th edition so I've reset the script back to include the two missing tables to match the book.
I've simplified it to not create the two unneeded tables (and the book step by step instructions) for the 9th edition this November.
The code generated by the EF Core tool has changed (again!). It shouldn't make a difference. I discuss a related issue in the following item: https://github.com/markjprice/cs12dotnet8/blob/main/docs/errata/improvements.md#page-640---customizing-the-model-and-defining-an-extension-method.
Thanks for that.
On page 634, the sql script Northwind4Sqlite.sql in the scripts/sql-scripts folder is missing two tables (EmployeeTerritory and Territory). The correct script is in the code/PracticalApps folder. The c# code on the following pages will not work without the correct database creation script.
Also, on page 640, in the code for OnModelCreating method, the properties have .HasDefaultValueSql("1") or .HasDefaultValueSql("0") whereas my code has .HasDefaultValue((short)1), .HasDefaultValue(0) or .HasDefaultValue(0.0) depending on the property type. Is this Ok?
Again, in the OnModelCreating method, the line for entity.Property(e => e.Discontinued) was not generated in my code.
My Configuration: Windows 11 v23H2, VS2022 v17.11.1, .NET SDK v8.0.400, SQLite v3.45.3.