Ejemplo n.º 1
0
        /// <summary>
        /// Ares all migrations applied.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>if the migrations were applied</returns>
        private static bool AreAllMigrationsApplied(SpellingContext 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());
        }