public void Save(mod.Auction auction) { Auction tc = _context.Auctions.Find(auction.Id); tc.Closingdate = auction.closingDate; tc.Sellerid = auction.SellerId; _context.SaveChanges(); }
public Auction Parse(mod.Auction auction) { Auction tc = new Auction(); tc.Sellerid = auction.SellerId; tc.Closingdate = auction.closingDate; if (tc.Id == null) { tc.Id = auction.Id; } return(tc); }
public mod.Auction AddAuction(mod.Auction newAuction) { if (Exists(newAuction.Id)) { newAuction = _mapper.Parse(_context.Auctions.Find(newAuction.Id)); } else { _context.Auctions.Add(_mapper.Parse(newAuction)); _context.SaveChanges(); } return(newAuction); }