Beispiel #1
0
 public ActionResult <IEnumerable <Bet> > Get()
 {
     using (var dbContext = new EzBetDbContext())
     {
         return(dbContext.Bets.ToList());
     }
 }
Beispiel #2
0
 public void Delete(int id)
 {
     using (var dbContext = new EzBetDbContext(contextOptions))
     {
         var betToDelete = dbContext.Find <Bet>(id);
         dbContext.Remove(betToDelete);
     }
 }
Beispiel #3
0
 public ActionResult <IEnumerable <Bet> > Get()
 {
     using (var dbContext = new EzBetDbContext(contextOptions))
     {
         var bets = dbContext.Bets.ToList();
         return(bets);
     }
 }
Beispiel #4
0
 public ActionResult <Bet> Get(int id)
 {
     using (var dbContext = new EzBetDbContext(contextOptions))
     {
         var bet = dbContext.Find <Bet>(id);
         if (bet == null)
         {
             return(NotFound());
         }
         return(bet);
     }
 }