0

I have a class Element with the properties Id (which is unique) SuperElement, which is above my Element and a List of SubElements which are below my Element.

public class Element
{
    public string Id { get; set; }
    public Element SuperElement { get; set; }
    public List<Element> SubElements { get; set; }
}

In the end this thing looks like a graph with a single node at the beginning, which is my root element and each with a list of elements below. Is there any class in C# where this pattern is already implemented? I want methods to insert a new ID at the right point within that graph + find elements by Id in that graph + iterate through all elements in that graph and so on.

Patrick
  • 173
  • 9
  • You mean something like this: https://stackoverflow.com/questions/1578493/net-graph-library-around – Rand Random Aug 08 '22 at 13:37
  • and to me is seems you are asking for a recommandation of a tool which is off topic here on stackoverflow, did you already do basic google / nuget search eg. https://www.nuget.org/packages?q=graph or https://nugetmusthaves.com/tag/graph – Rand Random Aug 08 '22 at 13:39
  • To be honest I don't really know what I am searching for. I thought there would be something basic like `List` but I did not find anything. – Patrick Aug 08 '22 at 18:14

0 Answers0