コード例 #1
0
 public User GetById(int id)
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         return(dbContext.Users.FirstOrDefault(x => x.Id == id));
     }
 }
コード例 #2
0
 public IEnumerable <RoundResult> GetAll()
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         return(dbContext.RoundResults.ToList());
     }
 }
コード例 #3
0
 public IEnumerable <User> GetAll()
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         return(dbContext.Users.ToList());
     }
 }
コード例 #4
0
 public RoundResults GetById(int id)
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         return(dbContext.RoundResults.FirstOrDefault(x => x.RoundId == id));
     }
 }
コード例 #5
0
 public void Update(User entity)
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         dbContext.Users.Update(entity);
         dbContext.SaveChanges();
     }
 }
コード例 #6
0
 public void Delete(Ticket entity)
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         dbContext.Tickets.Add(entity);
         dbContext.SaveChanges();
     }
 }
コード例 #7
0
 public void Update(RoundResult entity)
 {
     using (var dbContext = new LottoDbContext(_connectionString))
     {
         dbContext.RoundResults.Update(entity);
         dbContext.SaveChanges();
     }
 }
コード例 #8
0
 public UserRepository(LottoDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #9
0
 public TicketRepository(LottoDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #10
0
 public UserRepository(LottoDbContext context)
 {
     _context = context;
 }
コード例 #11
0
 public SessionRepository(LottoDbContext context)
 {
     _context = context;
 }
コード例 #12
0
 public RoundRepository(LottoDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #13
0
 public TicketRepository(LottoDbContext context)
 {
     _context = context;
 }