Inheritance: IAggregateDataModel
Esempio n. 1
0
        public void Add(Auction auction)
        {
            var snapshot = auction.GetSnapshot();
            var auctionDTO = new AuctionDTO();

            Map(auctionDTO, snapshot);
                        
            _unitOfWork.RegisterNew(auctionDTO, this);
        }
Esempio n. 2
0
        public void Save(Auction auction)
        {
            var snapshot = auction.GetSnapshot();
            var auctionDTO = new AuctionDTO(); 
           
            Map(auctionDTO, snapshot);

            _unitOfWork.RegisterAmended(auctionDTO, this);
        }
Esempio n. 3
0
 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;
     }
 }