Exemplo n.º 1
0
        public void Save(mod.Auction auction)
        {
            Auction tc = _context.Auctions.Find(auction.Id);

            tc.Closingdate = auction.closingDate;
            tc.Sellerid    = auction.SellerId;
            _context.SaveChanges();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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);
 }