Exemple #1
0
        public static bool AllMigrationsApplied(this FeederContext context)
        {
            var applied = context.GetService <IHistoryRepository>()
                          .GetAppliedMigrations()
                          .Select(m => m.MigrationId);

            var total = context.GetService <IMigrationsAssembly>()
                        .Migrations
                        .Select(m => m.Key);

            return(total.Except(applied).Any());;
        }
Exemple #2
0
 public static void EnsureMigrated(this FeederContext context)
 {
     context.Database.Migrate();
 }