7

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. enter image description here

3
  • Some (or all) of Entity Framework moved out of System.Data and into NuGet packages. May 10, 2015 at 23:01
  • You shouldn't use Asp.Net 5 for any public applications at this point. It does not have a Go Live license yet, and ONLY Entity Framework 7 is supported, which is still in Beta state. github.com/aspnet/EntityFramework/releases/tag/7.0.0-beta4
    – Claies
    May 10, 2015 at 23:24
  • I'm totally agree with you @Claies, I'm just gathering info for a future migration... Thanks. May 10, 2015 at 23:43

1 Answer 1

19

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

3
  • .NET Core RTM does support EF6. Not sure when EF6 support was added but it's there now. Tutorial here.
    – David
    Jul 11, 2016 at 12:40
  • @David ASP.NET Core is not .NET Core. That link is about ASP.NET Core running on the full desktop .NET Framework.
    – user743382
    May 30, 2017 at 0:20
  • 8
    That link is broken
    – eKelvin
    Jun 12, 2018 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.