using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
public int? Id { get; set; }
public int? ParentId { get; set; }
public string Name{get;set;}
public IEnumerable<NavBarItem> Children { get; set; }
public int ChildCount { get; set; }
public int HierarchyLevel { get; set; }
public int GetChildCount() => Children?.Sum(c => 1 + c.GetChildCount()) ?? 0;