private int CountChildren(TerritoryPartRecord tpr)
 {
     if (tpr.Children == null || !tpr.Children.Any())
     {
         return(0);
     }
     return(tpr.Children.Count + tpr.Children.Sum(CountChildren));
 }
Ejemplo n.º 2
0
 private void AssignHierarchyToChildren(TerritoryPartRecord tpr, TerritoryHierarchyPartRecord thpr)
 {
     tpr.Hierarchy = thpr;
     if (tpr.Children != null && tpr.Children.Any())
     {
         foreach (var child in tpr.Children)
         {
             AssignHierarchyToChildren(child, thpr);
         }
     }
 }