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

后端 未结 3 1636
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: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

提交回复
热议问题