public void RemoveApplicationGroup(IApplicationGroup applicationGroup) { if (!_applicationGroups.Remove(applicationGroup)) { throw new InvalidOperationException("Cannot remove application group from initiative."); } }
public void AddApplicationGroup(IApplicationGroup applicationGroup) { if (_applicationGroups.Any(x => string.Compare(x.Name, applicationGroup.Name, StringComparison.InvariantCultureIgnoreCase) == 0)) { throw new InvalidOperationException("There is already an application group with this name in this initiative."); } _applicationGroups.Add(applicationGroup); }
public static ApplicationGroup ToModel(this IApplicationGroup item) { return(new ApplicationGroup(item.Name, item.Applications.Select(x => x.ToModel()))); }