Example #1
0
 public HomeController(MyDbContext someDb = null)
 {
     //If we were given a null context, just use the default context
     if (someDb == null)
     {
         Db = new MyDbContext("MyDbContext");
     }
     else
     {
         //otherwise, use the supplied context
         Db = someDb;
     }
 }
Example #2
0
 public HomeController(MyDbContext someDb = null)
 {
     //If we were given a null context, just use the default context
     if (someDb == null)
     {
         Db = new MyDbContext("MyDbContext");
     }
     else
     {
         //otherwise, use the supplied context
         Db = someDb;
     }
 }