Esempio n. 1
0
        public AuctionStatus AuctionStatus(Guid auctionId)
        {
            var auction = _auctions.FindBy(auctionId);

            var status = new AuctionStatus();

            status.AuctionEnds = auction.EndsAt;
            status.Id = auction.Id;

            if (auction.HasBeenBidOn())
            {
                status.CurrentPrice = auction.WinningBid.CurrentAuctionPrice.Amount.Value;
                status.WinningBidderId = auction.WinningBid.Bidder;
            }

            status.TimeRemaining = TimeRemaining(auction.EndsAt);
            status.NumberOfBids = _bidHistory.NoOfBidsFor(auctionId);

            return status;
        }
Esempio n. 2
0
        public AuctionStatus AuctionStatus(Guid auctionId)
        {
            var auction = _auctions.FindBy(auctionId);

            var status = new AuctionStatus();

            status.AuctionEnds = auction.EndsAt;
            status.Id          = auction.Id;

            if (auction.HasBeenBidOn())
            {
                status.CurrentPrice    = auction.WinningBid.CurrentAuctionPrice.Amount.Value;
                status.WinningBidderId = auction.WinningBid.Bidder;
            }

            status.TimeRemaining = TimeRemaining(auction.EndsAt);
            status.NumberOfBids  = _bidHistory.NoOfBidsFor(auctionId);

            return(status);
        }