Example #1
0
 private void Init(MyDataContextConfiguration config)
 {
     if (config.InitDatabase)
     {
         Database.SetInitializer(new InitDatabase(config));
     }
     else
     {
         Database.SetInitializer <MyDataContext>(null); // must be turned off before mini profiler runs
     }
 }
Example #2
0
 public MyDataContext(MyDataContextConfiguration config)
     : base(config.NameOrConnectionString)
 {
     if (config.InitDatabase)
     {
         Database.SetInitializer(new InitDatabase(config));
     }
     else
     {
         Database.SetInitializer <MyDataContext>(null); // must be turned off before mini profiler runs
     }
 }
Example #3
0
 public InitDatabase(MyDataContextConfiguration config)
 {
     _config = config;
 }
Example #4
0
 public MyDataContext(MyDataContextConfiguration config)
     : base(config.NameOrConnectionString)
 {
     Init(config);
 }