InitializeDatabase() public method

public InitializeDatabase ( Database db ) : void
db Database
return void
Esempio n. 1
0
        public void InitializeDatabase(T context)
        {
            Database db = context.Database;

            if (!db.Exists() || !db.CompatibleWithModel(false))
            {
                db.Delete();
                db.Create();
            }
            DbInitializer dbinitializer = InitializerFactory.GetDbInitializerFor <T>();

            dbinitializer.InitializeDatabase(db);

            Seed(context);
        }
Esempio n. 2
0
        public void InitializeDatabase(T context)
        {
            Database db = context.Database;

            if (db.Exists())
            {
                db.Delete();
            }
            db.Create();

            DbInitializer dbinitializer = InitializerFactory.GetDbInitializerFor <T>();

            if (dbinitializer != null)
            {
                dbinitializer.InitializeDatabase(db);
            }

            Seed(context);
        }