public void Delete(int id) { using (var dbContext = new EzBetDbContext(contextOptions)) { var betToDelete = dbContext.Find <Bet>(id); dbContext.Remove(betToDelete); } }
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); } }