sajesh Nambiar
sajesh Nambiar

Reputation: 699

Convert EDMX to Code first to upgrade from.net framework 4.6 to .net Core 2.0

I need to upgrade my existing .net framework project to .net core 2.0. I have noticed that .NET Core 2.0 doesn't have support for EDMX (Entity Framework). Do I need to convert EDMX to Code First approach and then upgrade to .NET Core? What is the easiest and quickest way to do that? Will EF 5.x DbContext Fluent Generator for C# help to convert EDMX to Code First?

Upvotes: 3

Views: 2347

Answers (1)

Ljubomir Bacovic
Ljubomir Bacovic

Reputation: 584

You do not convert EDMX to Code First. What you need to do is reversed engineering by Scaffold-DbContext command, based on the existing database. You can completely remove the EDMX, current context and model classes and let EF Core scaffold new classes. From that point on, you work in Code First mode (make changes to model classes and create migrations, etc). Please see this link for instruction how to do it:

https://www.entityframeworktutorial.net/efcore/create-model-for-existing-database-in-ef-core.aspx

Upvotes: 3

Related Questions