Пример #1
0
 private static void MigrationServiceMigrating(object sender, MigrationEventArgs args)
 {
     stopwatch = Stopwatch.StartNew();
 }
Пример #2
0
 private static void MigrationServiceMigrated(object sender, MigrationEventArgs args)
 {
     if (args.Mode == MigrationMode.Upgrade)
         using (new ConsoleStylingScope(ConsoleColor.Green))
             System.Console.WriteLine(Resources.UpgradedToVersion, args.Version, stopwatch.Elapsed.TotalSeconds);
     else
     {
         long currentMigrationVersion = MigrationVersionInfoManagerUtil.GetCurrentMigrationVersion(
             serviceProvider.GetService<IMigrationVersionInfoManager>(),
             serviceProvider.GetService<IDbPlatform>(), parameters.ConnectionString);
         using(new ConsoleStylingScope(ConsoleColor.Yellow))
             System.Console.WriteLine(Resources.DowngradedToVersion,
                 currentMigrationVersion, stopwatch.Elapsed.TotalSeconds);
     } // else
 }