public void AddDemand(Demand demand) { if (demand.IsNull()) { throw new ArgumentNullException(nameof(demand)); } GroupDemands newGroupDemand = new GroupDemands(this, demand, false); GroupDemands.Add(newGroupDemand); }
/// <summary> /// Creates a new group for the demand /// </summary> /// <param name="demand">First demand to be included in the new group (the lead demand)</param> public Group(Demand demand) { if (demand.IsNull()) { throw new ArgumentNullException(nameof(demand)); } Category = demand.Category; Offers = new List <Offer>(); // No offers at the moment GroupDemands newGroupDemand = new GroupDemands(this, demand, true); GroupDemands = new List <GroupDemands>() { newGroupDemand }; }
public int GetNumberOfDemands() { return(GroupDemands.Count()); }
/// <summary> /// Get the demands included /// </summary> /// <returns></returns> public IEnumerable <Demand> GetDemands() { return(GroupDemands.Select(gd => gd.Demand)); }