Esempio n. 1
0
        public void SubmitBid(Bid bid)
        {
            if (Bids == null)
                Bids = new List<Bid>();

            var existingBid = Bids.SingleOrDefault(b => b.Agent.Id == bid.Agent.Id);

            if (existingBid != null)
                throw new Exception("Can't bid on the same task twice!");

            Bids.Add(bid);
        }
Esempio n. 2
0
 public void AcceptWinningBid(int bidId)
 {
     var bid = Bids.SingleOrDefault(b => b.Id == bidId);
     WinningBid = bid;
     Status = TaskStatus.Completed;
 }