Exemplo n.º 1
0
        public AuctionStatus ConvertToStatus(AuctionSnapshot snapshot)
        {
            var status = new AuctionStatus();

            status.AuctionEnds   = snapshot.EndsAt;
            status.Id            = snapshot.Id;
            status.TimeRemaining = TimeRemaining(snapshot.EndsAt);

            if (snapshot.WinningBid != null)
            {
                status.NumberOfBids    = _bidHistory.NoOfBidsFor(snapshot.Id);
                status.WinningBidderId = snapshot.WinningBid.BiddersId;
                status.CurrentPrice    = snapshot.WinningBid.CurrentPrice;
            }

            return(status);
        }
Exemplo n.º 2
0
        public AuctionStatus ConvertToStatus(AuctionSnapshot snapshot)
        {
            var status = new AuctionStatus();

            status.AuctionEnds = snapshot.EndsAt;            
            status.Id = snapshot.Id;
            status.TimeRemaining = TimeRemaining(snapshot.EndsAt);

            if (snapshot.WinningBid != null)
            {
                status.NumberOfBids = _bidHistory.NoOfBidsFor(snapshot.Id);
                status.WinningBidderId = snapshot.WinningBid.BiddersId;
                status.CurrentPrice = snapshot.WinningBid.CurrentPrice;
            }
            
            return status;
        }