Example #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);
        }
Example #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);
        }