и родителем
                  
                  
                  public class Entity
                  
                  
                      {
                  
                  
                          public int Id { get; set; }
                  
                  
                          public string Name { get; set; }
                  
                  
                          public string Description { get; set; }
                  
                  
                          public IList<Entity> Children { get; set; }
                  
                  
                      }
                  
                  
                  
                  
                  
                  Или вот так?
                  
                  
                  
                  
                  
                  public class Entity
                  
                  
                      {
                  
                  
                          public int Id { get; set; }
                  
                  
                          public string Name { get; set; }
                  
                  
                          public string Description { get; set; }
                  
                  
                  
                  
                  
                          public int ParentId { get; set; }
                  
                  
                          public Entity Parent { get; set; }
                  
                  
                      }
                  
                  
                
ну это 2 принципиально разных подхода
public class Entity { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } public Entity Parent { get; set; } public IList<Entity> Children { get; set; } }
Обсуждают сегодня