public void Remove(Lot lot) { using (AuctionContext auctionContext = new AuctionContext()) { auctionContext.Entry <Lot>(lot).State = EntityState.Deleted; auctionContext.SaveChanges(); } }
public void Edit(User user) { using (AuctionContext auctionContext = new AuctionContext()) { auctionContext.Entry <User>(user).State = EntityState.Modified; auctionContext.SaveChanges(); } }
public void Edit(Lot lot) { using (AuctionContext auctionContext = new AuctionContext()) { auctionContext.Entry <Lot>(lot).State = EntityState.Modified; auctionContext.SaveChanges(); } }
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(); } }