I have a database with many tables. I want to scaffold it with my ASP.NET Core 6.0 MVC project. Problem is: I do not want all the tables but only some of them.
Let's say there are 100 tables and I want to scaffold only 40 of them.
I know the command
Scaffold-DbContext "Server=;Database=;user id=;password=;" Microsoft.EntityFrameworkCore.SqlServer
-OutputDir -Tables
but in this way, I'd have to write all the tables' name 1 by 1.
Is there an easy way that I can scaffold many tables or is there a command to scaffold the ones starting with an 'a'
?
CodePudding user response:
You can specify based on schema using the --schema
option or by table using the --table
option
CodePudding user response:
The EF Core Power Tools have a UI for selecting the tables to scaffold.