Migrating from EF 6.1.2 to EF Core (2.1). How to deal with the Migrations?

ef-migrations entity-framework-6 entity-framework-core

Question

As performance of our application is lack lustre we may try to migrate it from using Entity Framework 6.1.2 to Entity Framework Core 2.1. I cannot find a clear overview what pitfalls there will be. I do not expect too much problems arising from the need to rewrite some queries, but I am especially wondering what needs to be done about our 30+ migrations that we have for the database.

Are there examples on how to migrate Migrations from EF 6 to EF-core 2.1?

1
1
4/22/2018 1:32:52 PM

Popular Answer

If you have EF 6 as Database-First and EF Core is Code-First. You can use reverse POCO generator. Then run Add-Migration to generate migration. Now you have to take care, You need to remove the changes from Up method. Now run Update-Database. From now onwards follow Code-first approach. you make changes in model, generate migration and run Update-Database.

Welcome yo EF Core.

1
4/22/2018 5:19:20 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