简体   繁体   English

反正在.NET Core中使用Entity Framework吗?

[英]Is there anyway to use Entity Framework in .NET Core?

I've just changed to the new ASP.NET 5 platform. 我刚刚改用新的ASP.NET 5平台。 I use visual studio code as my default IDE, and DNX for execution. 我使用visual studio代码作为我的默认IDE,并使用DNX执行。 .NET Core is now by default but I need to switch to .NET Framework always I want to reference the System.Data.Entity namespace or the TodoContext class . .NET Core现在默认情况下,但我需要切换到.NET Framework,我想引用System.Data.Entity命名空间或TodoContext类

Is there anyway to use EF in .NET Core? 无论如何在.NET Core中使用EF?

This is what I'm doing now. 这就是我现在正在做的事情。 在此输入图像描述

The EntityFramework in System.Data is version 6. If you want to use .NET Core then you need to switch to EF 7 which no longer lives in System.Data but in the EntityFramework.* nuget packages. System.Data的EntityFramework是版本6.如果要使用.NET Core,则需要切换到不再存在于System.Data但位于EntityFramework.* nuget包中的EF 7。

Here is an example: https://github.com/aspnet/MusicStore/blob/master/src/MusicStore/project.json#L15 这是一个例子: https//github.com/aspnet/MusicStore/blob/master/src/MusicStore/project.json#L15

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

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