ADO.NET entity data model (.edmx) in ASP.NET MVC core 1.0

后端 未结 3 1635
Happy的楠姐
Happy的楠姐 2020-12-11 13:59

I have couple of questions regarding how to use ADO.NET entity data model (.edmx) in ASP.NET MVC core 1.0 application-

  1. As we are migrating application from

相关标签:
3条回答
  • 2020-12-11 14:38

    As the other answers have alluded to, there is no support for EDMX. You will need to regenerate your ED models from the data using the new dotnet scaffold command line utility. You can also use that command to scaffold incremental changes to the database.

    Check out the documentation for "dotnet" (you might also be interested in migrations` once you move away from EDMX).

    Scaffold Command Documentation

    0 讨论(0)
  • 2020-12-11 14:52

    ADO.NET entity data model (.edmx) is not supported in Entity Framework Core. Microsoft explained here how to port it.

    0 讨论(0)
  • 2020-12-11 14:59

    The closest you can come to porting is to create the model in another project,then copy those files into your .NET core application. This will only work if you have chosen a core application that references the previous Frameworks (4.61, 4.52, etc.) When you copy in the EDMX and associated files, you must make sure that they go into the same project as the .Net core application. (If you reference from another project, you will encounter Visual Studio build errors saying that the EntityFramework.dll can't be accessed. ). After copying in the files, add in EntityFramework from Nuget to fix your dbContext and DbSet references. Here is a good article about how to set up the dependency injection in .Net core for EF6:Tony Sneed Blog

    0 讨论(0)
提交回复
热议问题