We can run the following command, which will create the context and models in the project:
Scaffold-DbContext -Connection "Data Source=somedatasource.com;Initial Catalog=mydb;Integrated Security=False;User Id=user;Password=pass;MultipleActiveResultSets=True" -Provider Microsoft.EntityFrameworkCore.SqlServer -Tables PrdSalesRegion -Context SalesRegionContext
How to specify different output folders for context and tables?
When I try to do this:
Scaffold-DbContext -Connection "Data Source=somedatasource.com;Initial Catalog=mydb;Integrated Security=False;User Id=user;Password=pass;MultipleActiveResultSets=True" -Provider Microsoft.EntityFrameworkCore.SqlServer -Tables Models/PrdSalesRegion -Context Context/SalesRegionContext
Please note that the only change:
-Tables Models/PrdSalesRegion -Context Context/SalesRegionContext
Then I get this output:
The context class name passed in to Context / SalesRegionContext is not a valid C # identifier.
How to specify different output folders for context and tables?
source
share