Beispiel #1
0
 public static void Main()
 {
     using (var db = new FootballBettingDbContext())
     {
         db.Database.Migrate();
     }
 }
 public void Run()
 {
     using (var db = new FootballBettingDbContext())
     {
         InitializeDatabase(db);
     }
 }
 public static void Main()
 {
     using (FootballBettingDbContext database = new FootballBettingDbContext())
     {
         PrepareDatabase(database);
     }
 }
Beispiel #4
0
 public static void Main(string[] args)
 {
     using (var dbContext = new FootballBettingDbContext())
     {
         dbContext.Database.Migrate();
     }
 }
Beispiel #5
0
 public static void Main()
 {
     using (var db = new FootballBettingDbContext())
     {
         // db.Database.Migrate();
         db.Database.EnsureDeleted();
         db.Database.EnsureCreated();
     }
 }
        private void InitializeDatabase(FootballBettingDbContext db)
        {
            Console.WriteLine("Initializing database...");

            db.Database.EnsureDeleted();
            db.Database.EnsureCreated();

            Console.WriteLine("Database Ready.");
        }
Beispiel #7
0
        public static void Main()
        {
            using (var db = new FootballBettingDbContext())
            {
                var seedingData = new SeedData(db);

                // seedingData.SeedUsers();
                // seedingData.SeedContinents();
                seedingData.SeedCountries();
            }
        }
Beispiel #8
0
        public static void Main(string[] args)
        {
            var context = new FootballBettingDbContext();

            InitiateDatabase(context);
        }
Beispiel #9
0
 private static void InitiateDatabase(FootballBettingDbContext context)
 {
     context.Database.Migrate();
 }
Beispiel #10
0
 public SeedData(FootballBettingDbContext db)
 {
     this.db = db;
 }
 private static void PrepareDatabase(FootballBettingDbContext database)
 {
     database.Database.EnsureDeleted();
     database.Database.EnsureCreated();
 }