EF Core 1.1 - How to check DbContext if migrations have been applied?

entity-framework-core

Question

In EntityFramework Core 1.1 this method does not seem to exist anymore:

DbContext.AllMigrationsApplied() 

What is the preferred way of doing this now. Is it?

if (!context.Database.GetPendingMigrations().Any())
1
12
11/29/2016 5:40:06 PM

Accepted Answer

I don't think AllMigrationsApplied ever existed in Entity Framework...

Yes, !context.Database.GetPendingMigrations().Any() is the best way to do this in EFCore 1.1.0+.

18
11/29/2016 9:20:00 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