How can I use MVC4 Migrations without using Entity Frameworks?

dapper data-migration ef-code-first entity-framework

Question

How can I use MVC4 Migrations without using Entity Frameworks? I would really like to use data migrations but I am not using Entity Frameworks. I am using dapper-dot-net.

Accepted Answer

Yes, you can use Migrations without using Entity Framework. All Migrations cares about is the metadata it uses to manage the database and you need to use some EF stuff to handle that, but you then don't ever need to use EF to actually access the database. This blog post describes the process in detail: http://weblogs.asp.net/fredriknormen/archive/2012/02/15/using-entity-framework-4-3-database-migration-for-any-project.aspx


Popular Answer

Check out Insight.Database.Schema on NuGet. It gives you a lot of the magic of migrations without the hassle of EF. I'll be updating the docs on github over the next few days.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why