public static void Drop()
        {
            Database.SetInitializer<QuestionsDbContext>(new DropCreateDatabaseAlways<QuestionsDbContext>());
            QuestionsDbContext ctx = new QuestionsDbContext();
            ctx.Database.Initialize(true);
            ctx.Dispose();
            Database.SetInitializer<QuestionsDbContext>(null);
        }
예제 #2
0
        public static void Drop()
        {
            Database.SetInitializer <QuestionsDbContext>(new DropCreateDatabaseAlways <QuestionsDbContext>());
            QuestionsDbContext ctx = new QuestionsDbContext();

            ctx.Database.Initialize(true);
            ctx.Dispose();
            Database.SetInitializer <QuestionsDbContext>(null);
        }