Пример #1
0
 public IHttpActionResult ConnectToDb()
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <StatesDbContext, Migrations.Configuration>("DefaultConnection"));
     //
     using (var lContext = new StatesDbContext("DefaultConnection"))
         try { return(Ok(lContext.Players.Count())); }//end try
         catch (Exception lError) { return(StatusCode(HttpStatusCode.InternalServerError)); }//end catch
 }
 public GameRepository(StatesDbContext context) : base(context)
 {
 }
 public TeamRepository(StatesDbContext context) : base(context)
 {
 }
 public Repository(StatesDbContext context)
 {
     _lContext = context;
 }
 public PlayerRepository(StatesDbContext context) : base(context)
 {
 }