Why to use fluentmigrator?

2019-07-26 09:35发布

问题:

When and why to use FluentMigrator as Entity Framework does the same job. If I have code- database then structures are already there and EF already provides classes to manipulate database.

I am not clear why and when(in which cases) to use fluentmigrator?

Thanks

回答1:

Not everybody uses Entity Framework. I don't use it in my current project for example. In this scenario FluentMigrator is very useful for managing the database changes for each release.



回答2:

EntityFramework kind of gives you both tasks: ORM and migration (CodeFirst).

I, for instance, use NHibernate and use FluentMigrator. The first as ORM and the second as the database migration library. You could say indeed that I am writing two faces of the same concept so it is more maintenance costs, however, I prefer higher control over this (ORM and migration separately) because you could screw up very easily if it's not explicit up front.



回答3:

Adding to the examples above: in case you use some Micro ORM like Dapper, you'll need a separate tool for database migrations. That's what Fluent Migrator is all about.