Question

Getting exposed to dotnet Core. In a sample test application trying to setup EntityFramework.Core in dotnet core app. While I was able to add the EntityFramework.Core NugGet package I can't find the 'Add'->'New Item'->'Data'->'ADO.NET Entity Data Model'

Is this not possible with EntityFramework.Core?

How does EntityFramework.Core differ from EntityFramework 7?

1
13
12/10/2016 11:41:08 AM

Accepted Answer

There is no edmx support in Entity Framework Core. It only supports a code-first approach. The option to add a new Entity Data Model will be added, but it will produce entity class files instead of an edmx file. The tooling development is a little bit behind the framework development currently.

15
9/20/2016 6:59:46 PM

Popular Answer

Still no EDMX support yet for .Net core. To generate the dbcontext and entities from database, run below command in package manager console:

Scaffold-DbContext "Server=yourserver;Database=yourdatabase;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

You will need these packages:

Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.SqlServer.Design

https://ef.readthedocs.io/en/staging/platforms/aspnetcore/existing-db.html#install-entity-framework



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