How would you generate view models and entities classes in .net core

.net-core code-generation entity-framework-core

Question

So there is no edmx in .net core how would you generate entities, view models and mappings, stored procs using .net core?

Is there any way you can do that without having edmx?

1
0
5/7/2017 1:51:30 AM

Popular Answer

Database First approach is supported in Entity Framework Core: .NET Framework - Existing Database (the same principles for Full .NET and .NET Core targeted applications).

In details, following commands are used to create DbContext from a database:

Powershell: Scaffold-DbContext;

CMD: dotnet ef dbcontext scaffold.

At this moment, DB First has some significant limitations: it is impossible to customize reverse engineering at table level and so on. Check the EF Core Roadmap to ensure it is suitable for you. For example:

We also plan to work on the following features, but they may not be fully implemented in 2.0.

Update model from database (#831) - Allows you to incrementally update a model, that was previously reverse engineered from a database, with changes that were since made to the database schema. This allows you to update the model to match the current schema, without loosing any changes that were manually made to the model after it was reverse engineered.

Update: There are few minor reverse engineering features and fixes in EF Core 2.0.0-preview1.

1
5/12/2017 2:04:51 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