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.