markjprice / cs11dotnet7

Repository for the Packt Publishing book titled "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals" by Mark J. Price
566 stars 206 forks source link

Scaffolding #89

Closed K-Ibadullaev closed 9 months ago

K-Ibadullaev commented 9 months ago

Hello Mr. Price,

I would like to know how to fix the following issue in the chapter 10 "working with EF Core/Scaffolding". I used a suggested prompt from the improvements but got the warning that dotnet can't find the tables Products and Categories in the database. Though the SQLITE Viewer shows them. What could lead to such an output? Could it be caused by the northwind.sql script or user "rights"/PATH?

Thanks in advance! P.s. Your book is awesome!

dotnet ef dbcontext scaffold "Filename=Northwind.db" Microsoft.EntityFrameworkCore.Sqlite --table Categories --table Products --output-dir AutoGenModels --namespace WorkingWithEFCore.AutoGen --data-annotations --context Northwind

Build started...
Build succeeded.
k/?LinkId=723263.
Unable to find a table in the database matching the selected table 'Categories'.
Unable to find a table in the database matching the selected table 'Products'.

Chapter: 10 Page Number: 453 Section Title: Scaffolding models using an existing database Step Number: 2 Problem to fix: Unable to find Suggested solution: fix the SQL script?? Other useful information e.g. OS, coding tools, and so on: