Exemplo n.º 1
0
 public void Remove(Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Entry <Lot>(lot).State = EntityState.Deleted;
         auctionContext.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void Edit(Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Entry <Lot>(lot).State = EntityState.Modified;
         auctionContext.SaveChanges();
     }
 }
Exemplo n.º 3
0
 public void Add(Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Lots.Add(lot);
         auctionContext.SaveChanges();
     }
 }
Exemplo n.º 4
0
 public void Registartion(User user)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Users.Add(user);
         auctionContext.SaveChanges();
     }
 }
Exemplo n.º 5
0
 public void Edit(User user)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Entry <User>(user).State = EntityState.Modified;
         auctionContext.SaveChanges();
     }
 }
Exemplo n.º 6
0
 public void Buy(User user, Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         lot.Buyer   = user;
         lot.IdBuyer = user.Id;
         auctionContext.Entry <Lot>(lot).State = EntityState.Modified;
         auctionContext.SaveChanges();
     }
 }