SobekCM.Core.Aggregations.Complete_Item_Aggregation.Remove_Child C# (CSharp) Method

Remove_Child() public method

Removes a child from this collection, by aggregation code
public Remove_Child ( string AggregationCode ) : void
AggregationCode string Code of the child to remove
return void
        public void Remove_Child(string AggregationCode)
        {
            if (Children == null) return;

            // Get list of matches
            List<Item_Aggregation_Related_Aggregations> removes = Children.Where(ThisChild => ThisChild.Code == AggregationCode).ToList();

            // Remove all matches
            foreach (Item_Aggregation_Related_Aggregations toRemove in removes)
            {
                Children.Remove(toRemove);
            }
        }