Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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())
like image 686
Michael Dennis Avatar asked Nov 29 '16 17:11

Michael Dennis


1 Answers

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+.

like image 146
bricelam Avatar answered Nov 30 '22 23:11

bricelam