Question

I'm working on a new project, and I want to use the most recent version of.NET Core.

I discovered the comparison between Entity Framework Core and Entity Framework 6.x when reading the documentation.

Several of the characteristics I need include:Spatial Data Type NOT a feature of EF Core. Due to the Project's need for Spatial Data Type, I CANNOT utilize it.

I found this link on how to utilize EF 6.x with.NET Core when reading the docs once more: Here

The following is mentioned in the article:

Before you start, make sure that you compile against full .NET Framework in your project.json as Entity Framework 6 does not support .NET Core. If you need cross platform features you will need to upgrade to Entity Framework Core.

My project doesn't actually need to be cross-platform.

How to utilize EF6 with ASP.NET Core is not explained in great detail in the post.

I made a freshASP.NET Core Web Application

I then used Nuget Package Manager to install EF6 and encountered the following problem.

enter image description here

I went and got rid of thenetcoreapp1.0 from the structures inproject.json and farthernet46 as framework, which fixed the EF problem, but I'm now encountering another one.

enter image description here

  1. Consequently, how do I utilize EF6 with ASP.NET core?

  2. Does having to delete all.NET Core references while using EF6 indicate that I am not utilizing.NET Core? Other than the fact that it cannot operate across platforms, what are the drawbacks?

1
2
9/9/2016 7:26:01 PM

Popular Answer

Remove the following from the to stop the second error:dependencies a segment of yourproject.json :

"Microsoft.NETCore.App": {
    "version": "1.0.0",
    "type": "platform"
}

For reference, the referencing Entity Framework 6 and the full.NET Framework in an ASP.NET Core project documentation includes a comprehensiveproject.json example.

You are still utilizing ASP.NET Core even if you remove references to.NET Core. You are merely altering the platform that your ASP.NET Core project will run on as its target runtime.

You may take advantage of the new project structure and unified narrative for creating web UI and web APIs by combining ASP.NET Core with the full.NET Framework.Controller class), and you also have access to the mature, fully-featured.NET Framework. You may even utilize dependencies and NuGet products that haven't been converted to.NET Core, such Entity Framework 6, with this framework.

3
10/24/2016 1:58:06 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow