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); }
public void AcceptWinningBid(int bidId) { var bid = Bids.SingleOrDefault(b => b.Id == bidId); WinningBid = bid; Status = TaskStatus.Completed; }