简体   繁体   English

我可以使用Entity Framework 6(非实体框架核心)开发Asp.net核心MVC应用程序吗?

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

I want to use ASP.NET Core with my new project as I heard that it's faster. 我想在我的新项目中使用ASP.NET Core ,因为我听说它更快。 However, the project will use extensive database accessing feature of which some are not supported by Entity Framework Core . 但是,该项目将使用广泛的数据库访问功能,其中一些功能不受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 )? 我想知道,是否可以使用Entity Framework 6 (而非Entity Framework Core )开发ASP.NET Core MVC应用程序?

Based on the documentation of ASP.NET Core , it says: 根据ASP.NET Core文档 ,它说:

To use Entity Framework 6, your project has to compile against the full .NET Framework, as Entity Framework 6 does not support .NET Core. 要使用Entity Framework 6,您的项目必须针对完整的.NET Framework进行编译,因为Entity Framework 6不支持.NET Core。 If you need cross-platform features you will need to upgrade to Entity Framework Core. 如果您需要跨平台功能,则需要升级到Entity Framework Core。

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. 如果您只需要Net Core的速度,可以将Db Context类放在另一个.Net Framework项目中,然后从Net Core项目添加对该项目的引用。
By doing that, you can use EF 6 in Net core and also gain the speed of Net Core web project. 通过这样做,您可以在Net core中使用EF 6,并获得Net Core Web项目的速度。
The drawback is you loss cross-platform features. 缺点是您丢失了跨平台功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET MVC Core和Entity Framework中的ToListAsync无法正常工作 - ToListAsync in ASP.NET MVC Core and Entity Framework not working 无法将ASP.NET MVC Core 2.0与实体框架连接 - Trouble connecting ASP.NET MVC Core 2.0 with Entity Framework Asp.Net 核心 MVC 微软实体框架 - Asp.Net core MVC Microsoft Entity Framework 在 ASP.NET Core 2.1 MVC 中使用 Entity Framework Core 搭建新控制器的问题 - Problem scaffolding new controller using Entity Framework Core in ASP.NET Core 2.1 MVC 当我们使用带有Entity Framework的ASP.NET MVC应用程序开发时,应用类图的位置? - Where to apply class diagram when we develop using ASP.NET MVC application with Entity Framework? ASP.net Core Application Entity Framework 6无法生成数据库 - ASP.net Core Application Entity Framework 6 not generating database 不能将Asp.net核心2.0与实体框架6一起使用 - Can't use Asp.net core 2.0 with entity framework 6 ASP.NET Core MVC 1.3 Web API + Entity Framework,我无法按名称搜索数据库,但可以按 ID - ASP.NET Core MVC 1.3 Web API + Entity Framework, I can't search a database by name, but I can by id ASP.NET Core 使用 MVC 和 Entity Framework - 编辑方法不显示值 - ASP.NET Core using MVC with Entity Framework - Edit method not showing values 在 Entity Framework Core 和 ASP.NET Core 中加载相关数据 - Loading related data in Entity Framework Core and ASP.NET Core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM