示例#1
0
 private static void CleanUp()
 {
     using (var ctx = new TicketDeskContext("TicketDesk"))
     {
         ctx.Database.Delete();
     }
     using (var ctx = new EmptyDatabaseContext("TicketDesk2xRefernece"))
     {
         ctx.Database.Delete();
     }
 }
 private static void CleanUp()
 {
     using (var ctx = new TicketDeskContext("TicketDesk"))
     {
         ctx.Database.Delete();
     }
     using (var ctx = new EmptyDatabaseContext("TicketDesk2xRefernece"))
     {
         ctx.Database.Delete();
     }
 }
示例#3
0
        private void MakeLegacyDb()
        {
            var reader = System.IO.File.OpenText(@"..\..\SqlScripts\TicketDesk2DB\TicketDeskObjects.sql");
            var sql    = reader.ReadToEnd();

            Database.SetInitializer <EmptyDatabaseContext>(new DropCreateDatabaseAlways <EmptyDatabaseContext>());
            using (var ctx = new EmptyDatabaseContext("TicketDesk2xRefernece"))
            {
                ctx.Database.Initialize(true);
                ctx.Database.ExecuteSqlCommand(sql);
            }
        }
        private void MakeLegacyDb()
        {
            var reader = System.IO.File.OpenText(@"..\..\SqlScripts\TicketDesk2DB\TicketDeskObjects.sql");
            var sql = reader.ReadToEnd();

            Database.SetInitializer<EmptyDatabaseContext>(new DropCreateDatabaseAlways<EmptyDatabaseContext>());
            using (var ctx = new EmptyDatabaseContext("TicketDesk2xRefernece"))
            {
                ctx.Database.Initialize(true);
                ctx.Database.ExecuteSqlCommand(sql);
            }
        }