Наследование: ISeedRunner
Пример #1
0
 private static void Run()
 {
     int version = _options.TargetVersion ?? -1;
     string mode = (_options.Mode ?? "manual").ToLower();
     if (mode == "script") {
         RunScript(version);
         return;
     }
     if (mode == "auto") {
         var runner = new Runner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());
         runner.MigrationGroup = _options.MigrationGroup;
         runner.Run(version);
         return;
     }
     if (mode == "seed") {
         if (String.IsNullOrEmpty(_options.SeedName)) {
             Exit("Please, set the seed name");
             return;
         }
         var seedRunner = new SeedRunner(SharpFactory.Default.CreateDataClient(), GetAssemblyWithMigrations());
         seedRunner.Run(_options.SeedName, _options.SeedArgs, _options.MigrationGroup);
         return;
     }
     var crunner = new ConsoleRunner(SharpFactory.Default.ConnectionString, SharpFactory.Default.DataProviderName);
     crunner.AssemblyWithMigrations = GetAssemblyWithMigrations();
     crunner.MigrationGroup = _options.MigrationGroup;
     crunner.Start();
 }
 public void SetUp()
 {
     SeedForTest.Reset();
     var client = new Mock<IDataClient>();
     _seedRunner = new SeedRunner(client.Object, GetType().Assembly);
 }