public User GetById(int id) { using (var dbContext = new LottoDbContext(_connectionString)) { return(dbContext.Users.FirstOrDefault(x => x.Id == id)); } }
public IEnumerable <RoundResult> GetAll() { using (var dbContext = new LottoDbContext(_connectionString)) { return(dbContext.RoundResults.ToList()); } }
public IEnumerable <User> GetAll() { using (var dbContext = new LottoDbContext(_connectionString)) { return(dbContext.Users.ToList()); } }
public RoundResults GetById(int id) { using (var dbContext = new LottoDbContext(_connectionString)) { return(dbContext.RoundResults.FirstOrDefault(x => x.RoundId == id)); } }
public void Update(User entity) { using (var dbContext = new LottoDbContext(_connectionString)) { dbContext.Users.Update(entity); dbContext.SaveChanges(); } }
public void Delete(Ticket entity) { using (var dbContext = new LottoDbContext(_connectionString)) { dbContext.Tickets.Add(entity); dbContext.SaveChanges(); } }
public void Update(RoundResult entity) { using (var dbContext = new LottoDbContext(_connectionString)) { dbContext.RoundResults.Update(entity); dbContext.SaveChanges(); } }
public UserRepository(LottoDbContext dbContext) { _dbContext = dbContext; }
public TicketRepository(LottoDbContext dbContext) { _dbContext = dbContext; }
public UserRepository(LottoDbContext context) { _context = context; }
public SessionRepository(LottoDbContext context) { _context = context; }
public RoundRepository(LottoDbContext dbContext) { _dbContext = dbContext; }
public TicketRepository(LottoDbContext context) { _context = context; }