有没有在.NET Core中使用Entity Framework? [英] Is there anyway to use Entity Framework in .NET Core?

查看:174
本文介绍了有没有在.NET Core中使用Entity Framework?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚改成了新的ASP.NET 5平台。我使用visual studio代码作为我的默认IDE,DNX执行。 .NET Core现在是默认的,但是我需要切换到.NET Framework,总是要引用 System.Data.Entity 命名空间或 TodoContext类



有没有在.NET Core中使用EF?



这就是我'现在在做

解决方案

System.Data 中的EntityFramework是版本6.
如果要使用.NET Core,则需要切换到EF 7不再存在于System.Data中,而是位于 EntityFramework。* nuget包中。



示例: https://github.com/aspnet/MusicStore /blob/master/src/MusicStore/project.json#L15


I've just changed to the new ASP.NET 5 platform. I use visual studio code as my default IDE, and DNX for execution. .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.

Is there anyway to use EF in .NET Core?

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.

Here is an example: https://github.com/aspnet/MusicStore/blob/master/src/MusicStore/project.json#L15

这篇关于有没有在.NET Core中使用Entity Framework?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆