简体   繁体   English

ASP.NET Core 2.0中的EF 5/6

[英]EF 5/6 in ASP.NET Core 2.0

quick question really. 真的是个简单的问题。 Is the Entity Framework 5/6 supported in ASP.NET Core 2.0. ASP.NET Core 2.0是否支持实体框架5/6。 I was told it is not supported and wanted to know if someone has tried it? 有人告诉我它不受支持,想知道是否有人尝试过?

Thanks 谢谢

correct if you are targeting core. 如果您定位核心,则正确。 You could target the full framework though (even in your asp.net core application) 不过,您可以定位整个框架 (即使在asp.net核心应用程序中)

csproj: 的csproj:

<PropertyGroup>
  <TargetFramework>net461</TargetFramework>
  ...
</PropertyGroup>

https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6 https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6

No, Entity Framework 6 is not supported by .net core 2.0 否,.net core 2.0不支持Entity Framework 6

But you have some options: 但是您有一些选择:

  1. Reference net461 in your project (as it described by user1859022). 在项目中引用net461 (如user1859022所述)。 Then you will able to use full framework libraries, but only on Windows machines. 然后,您将能够使用完整的框架库,但只能在Windows计算机上使用。
  2. Reference " Microsoft.EntityFrameworkCore.SqlServer " nuGet package and use Entity Framework Core. 参考“ Microsoft.EntityFrameworkCore.SqlServer ” nuGet包并使用Entity Framework Core。 It will let you to use it on Linux. 它可以让您在Linux上使用它。 But Entity Framework Core is not so good as Entity Framework 6 yet and unfortunately have some restrictions. 但是,Entity Framework Core还不如Entity Framework 6好,而且不幸的是存在一些限制。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM