예제 #1
0
 public RoundResult GetById(int id)
 {
     using (var dbContext = new LottoContext())
     {
         return(dbContext.RoundResults.FirstOrDefault(x => x.Id == id));
     }
 }
예제 #2
0
 public IEnumerable <User> GetAll()
 {
     using (var dbContext = new LottoContext())
     {
         return(dbContext.Users.ToList());
     }
 }
예제 #3
0
 public IEnumerable <RoundResult> GetAll()
 {
     using (var dbContext = new LottoContext())
     {
         return(dbContext.RoundResults.ToList());
     }
 }
예제 #4
0
 public User GetById(int id)
 {
     using (var dbContext = new LottoContext())
     {
         return(dbContext.Users.FirstOrDefault(x => x.Id == id));
     }
 }
예제 #5
0
 public IEnumerable <Ticket> GetAll()
 {
     using (var dbContext = new LottoContext())
     {
         return(dbContext.Tickets.ToList());
     }
 }
예제 #6
0
 public void Update(RoundResult entity)
 {
     using (var dbContext = new LottoContext())
     {
         dbContext.RoundResults.Update(entity);
         dbContext.SaveChanges();
     }
 }
예제 #7
0
 public void Update(User entity)
 {
     using (var dbContext = new LottoContext())
     {
         dbContext.Users.Update(entity);
         dbContext.SaveChanges();
     }
 }
예제 #8
0
 public void Delete(User entity)
 {
     using (var dbContext = new LottoContext())
     {
         dbContext.Users.Remove(entity);
         dbContext.SaveChanges();
     }
 }
예제 #9
0
 public void Update(Ticket entity)
 {
     using (var dbContext = new LottoContext())
     {
         dbContext.Tickets.Update(entity);
         dbContext.SaveChanges();
     }
 }
예제 #10
0
 public DrawsRepo(LottoContext lottoContext)
 {
     _lottoContext = lottoContext;
 }
예제 #11
0
 public LoteriaController(LottoContext context)
 {
     _context = context;
 }