Sergino
Sergino

Reputation: 10818

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

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?

Upvotes: 0

Views: 496

Answers (1)

Ilya Chumakov
Ilya Chumakov

Reputation: 25019

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.

Upvotes: 1

Related Questions