public static void ApplyMigrations()
 {
     using (var context = new MyDbContext())
     {
         if (!context.AllMigrationsApplied())
         {
             context.Database.Migrate();
         }
     }
 }