Where is the EDMX

橙三吉。 提交于 2019-12-30 08:08:49

问题


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:


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.




回答2:


You can take advantage of edmx in dot net core, but only as a reference in order to create the classes that you need.

To do so, you have to add to your solution a project targeting dot net framework 3.5 or higher in order for edmx to work, add an existing edmx file from another, older project because visual studio 2019 does not have that template available, now you can clean it and add entities from sql server.

In the others dot net core project, you have to add t4 templates file .tt these files are going to read the edmx file through the file system path. You have to edit the .tt files in order to work with dot net core.

Once again, you don't need to reference the dot net framework project, it only exists so edmx can work.



来源:https://stackoverflow.com/questions/39600602/where-is-the-edmx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!