Ejemplo n.º 1
0
        private static void ExecDb1()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <Ef6Ctx, Ef6MigConf>());
            WhichDb.DbName   = "MSAMPLEDB";
            WhichDb.ConnType = ConnType.CtxViaDbConn;
            var sqlConn = GetSqlConn4DBName(WhichDb.DbName);
            var context = new Ef6Ctx(sqlConn);

            context.Database.Initialize(true);
            Console.WriteLine(WhichDb.DbName, context.Database.Exists());
            AddJunk(context);
        }
        private static void ExecDb1()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <Ef6Ctx, Ef6MigConf>());
            WhichDb.DbName   = "HACKDB1";
            WhichDb.ConnType = ConnType.CtxViaDbConn;
            var sqlConn = GetSqlConn4DBName(WhichDb.DbName);
            var context = new Ef6Ctx(sqlConn);

            context.Database.Initialize(true);
            Console.WriteLine(WhichDb.DbName, context.Database.Exists());
            AddJunk(context);
            //sqlConn.Close();  //?? whatever other considerations, dispose of context etc...
        }