Beispiel #1
0
 public void UpdateAuction(Auction auction)
 {
     var auctionToUpdate = _exchangeContext.Auctions.SingleOrDefault(a => a.Id == auction.Id);
     if (auctionToUpdate != null)
     {
         auctionToUpdate.Name = auction.Name;
         auctionToUpdate.Description = auction.Description;
         auctionToUpdate.OpenPrice = auction.OpenPrice;
         auctionToUpdate.StartDate = auction.StartDate;
         auctionToUpdate.PredictedEndDate = auction.PredictedEndDate;
         auctionToUpdate.Status = auction.Status;
         _exchangeContext.SaveChanges();
     }
 }
Beispiel #2
0
 public void AddAuction(Auction auction)
 {
     _exchangeContext.Auctions.Add(auction);
     _exchangeContext.SaveChanges();
 }