title: From the tree structure get list
body: <p>I have a class CategoryModel in c#, which is an element of a tree:</p>
  
  <pre><code>public class CategoryModel
  {
      public string Id { get; set; }
      public string Name { get; set; }
      public string NameEng { get; set; }
      public string ParentCategoryId { get; set; }
      public ICollection&lt;string&gt; ChildCategoriesIds { get; set; } = new List&lt;string&gt;();
      public ICollection&lt;string&gt; ProductsIds { get; set; } = new List&lt;string&gt;();
  }
  
  public class Product
  {
      public string Id { get; set; }
      public string Name { get; set; }
      public string NameEng { get; set; }
  }
  </code></pre>
  
  <p></p>
  
  <p>The <code>ChildCategoriesIds</code> contains <code>Id</code> class <code>CategoryModel</code>. 
  The <code>ProductsIds</code> contains <code>Id</code> class <code>Product</code>.</p>
  
  <p>How proccesed data in new classes:</p>
  
  <pre><code>public class CategoryNew
  {
      public string Uid { get; set; }
      public string Name { get; set; }
      public string NameEng { get; set; }
      public bool? IsDeleted { get; set; }
      public IEnumerable&lt;UidName&gt; ChildCategories { get; set; } = new List&lt;UidName&gt;();
      public IEnumerable&lt;UidName&gt; Products { get; set; } = new List&lt;UidName&gt;();
  }
  
  public class UidName
  {
      public string Uid { get; set; }
      public string Name { get; set; }
      public string NameEng { get; set; }
      public bool? IsDeleted { get; set; }
  }
  </code></pre>