public void Add(Auction auction) { var snapshot = auction.GetSnapshot(); var auctionDTO = new AuctionDTO(); Map(auctionDTO, snapshot); _unitOfWork.RegisterNew(auctionDTO, this); }
public void Save(Auction auction) { var snapshot = auction.GetSnapshot(); var auctionDTO = new AuctionDTO(); Map(auctionDTO, snapshot); _unitOfWork.RegisterAmended(auctionDTO, this); }
public void Map(AuctionDTO auctionDTO, AuctionSnapshot snapshot) { auctionDTO.Id = snapshot.Id; auctionDTO.StartingPrice = snapshot.StartingPrice; auctionDTO.AuctionEnds = snapshot.EndsAt; auctionDTO.Version = snapshot.Version; if (snapshot.WinningBid != null) { auctionDTO.BidderMemberId = snapshot.WinningBid.BiddersId; auctionDTO.CurrentPrice = snapshot.WinningBid.CurrentPrice; auctionDTO.MaximumBid = snapshot.WinningBid.BiddersMaximumBid; auctionDTO.TimeOfBid = snapshot.WinningBid.TimeOfBid; } }