Can I develop an Asp.net core MVC application using Entity Framework 6 (not Entity Framework core)?

纵然是瞬间 提交于 2019-12-11 01:38:28

问题


I want to use ASP.NET Core with my new project as I heard that it's faster. However, the project will use extensive database accessing feature of which some are not supported by Entity Framework Core. I want to know, is it possible to develop an ASP.NET Core MVC application using Entity Framework 6 (not Entity Framework Core)?


回答1:


Based on the documentation of ASP.NET Core, it says:

To use Entity Framework 6, your project has to compile against the full .NET Framework, as Entity Framework 6 does not support .NET Core. If you need cross-platform features you will need to upgrade to Entity Framework Core.




回答2:


If you only need the speed of Net Core, you can put your Db Context class in another .Net Framework project and then add reference to that project from Net Core project.
By doing that, you can use EF 6 in Net core and also gain the speed of Net Core web project.
The drawback is you loss cross-platform features.



来源:https://stackoverflow.com/questions/41953977/can-i-develop-an-asp-net-core-mvc-application-using-entity-framework-6-not-enti

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