Ivan
Ivan

Reputation: 101

Using Entity Framework 6 in ASP.NET Core

Let's say I have:

The ASP.NET Core project refers to the class library

This architecture proposed here:

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

The question is: will my standalone application be able to execute on the specified target platform (Win, Linux, Mac runtime) after Release (or Publish), if it's dependency targets to full .NET Framework?

Thanks very much

Upvotes: 9

Views: 3268

Answers (2)

Jonathan Magnan
Jonathan Magnan

Reputation: 11347

Disclaimer: I'm the owner of the project Entity Framework Classic

That's not possible directly Entity Framework as @Adailson answered

However, it's possible via EF Classic: http://entityframework-classic.net/

That's an EF6 fork that also supports .NET Core. We plan to integrate a ton of features & bug fix.

A community (FREE) and enterprise version (PAID) is available.

What's EF Classic

Entity Framework Classic is a supported version from the latest EF6 code base. It supports .NET Framework and .NET Core and overcomes some EF limitations by adding tons of must-haves built-in features.

Upvotes: 0

Adailson De Castro
Adailson De Castro

Reputation: 871

It will be not possible. The same link you provided confirm that:

To use Entity Framework 6, your project has to compile against .NET Framework, as Entity Framework 6 does not support .NET Core. If you need cross-platform features you will need to upgrade to Entity Framework Core.

You can use ASP.NET Core upon .NET Framework (Not .NET CORE) and EF6 (But not cross-platform). But not ASP.NET Core upon .NET Core and use EF6. You will need to use EF Core for that project.

Upvotes: 3

Related Questions