EF Core Db First - filter out tables based on schema name

c# entity-framework entity-framework-core

Question

I have database with multiple schemas.

How do I generate Entities only for tables within specified schema?

I could specify the table names in command line dotnet ef dbcontext scaffold --tables … but I hope there is better solution

1
0
12/10/2018 3:48:05 PM

Accepted Answer

Use --schema option.

--schema ... The schemas of tables to generate entity types for. To specify multiple schemas, repeat --schema for each one. If this option is omitted, all schemas are included.

https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#dotnet-ef-dbcontext-scaffold

0
12/10/2018 3:54:11 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow