Example #1
0
 protected override void Seed(TestDb context)
 {
     Console.WriteLine("Seeding Data..");
     CustomerSeeder.Seed(context, RELATIVE_FOLDER_DATA_SOURCES);
     RaceSeeder.Seed(context, RELATIVE_FOLDER_DATA_SOURCES);
     BetSeeder.Seed(context, RELATIVE_FOLDER_DATA_SOURCES);
 }
Example #2
0
        protected override void Seed(TestDb context)
        {
            var dbName = context.Database.GetDbConnection().Database;

            Console.WriteLine($"Deleting {dbName}..");
            context.Database.EnsureDeleted();

            Console.WriteLine($"Creating {dbName}..");
            context.Database.EnsureCreated();

            Console.WriteLine("Running Migration..");
            context.Database.Migrate();

            Console.WriteLine("Seeding Data..");
            CustomerSeeder.Seed(context, RELATIVE_FOLDER_DATA_SOURCES);
            RaceSeeder.Seed(context, RELATIVE_FOLDER_DATA_SOURCES);
            BetSeeder.Seed(context, RELATIVE_FOLDER_DATA_SOURCES);
        }