I have a database with 2 tables:
- Items
- ItemDependencies
Items has key of ID
ItemDependencies have two columns: ItemId, and DependsOnItemId
I conver this to a collection:
IEnumerable<Item> items = GetItems();
each item has a: Dependencies property which is a
List<Item>
So i want to filter the initial items list to:
Given a single item, i want a list of that item and all of the items that dependon this item recursively.
Given a single item, i want a list of that item and all of the other items that it depends on (also recursively).
what is the best way of doing this in C#, LINQ, or anything else that would do the trick.