public int GetMaxItemId() { if (ChildItems.Count == 0) { return(Id); } else { return(Math.Max(ChildItems.Select(x => x.GetMaxItemId()).ToList().Max(), Id)); } }