List<Categories> categories = new List<Categories>
{
new Categories { CatID = 1, CatName = "Computer, IT & Networking"},
new Categories { CatID = 2, CatName = "Computer & Servers"},
new Categories { CatID = 3, CatName = "Desktop PCs"},
new Categories { CatID = 4, CatName = "Servers"},
new Categories { CatID = 5, CatName = "Computer Parts & Components"},
new Categories { CatID = 6, CatName = "Harddrive"},
new Categories { CatID = 7, CatName = "CPUs"},
new Categories { CatID = 8, CatName = "Electronics"},
new Categories { CatID = 9, CatName = "Furniture"},
new Categories { CatID = 10, CatName = "RAM"},
new Categories { CatID = 11, CatName = "Harddrive"},
new Categories { CatID = 12, CatName = "Workbooks"},
new Categories { CatID = 13, CatName = "IBM Desktop"},
new Categories { CatID = 14, CatName = "HP Desktop"}
};
List<CategoriesMapping> categoriesMapping = new List<CategoriesMapping>
{
new CategoriesMapping { CategoriesMappingID = 1, CatID = 1, MapCatID = 2},
new CategoriesMapping { CategoriesMappingID = 2, CatID = 1, MapCatID = 5},
new CategoriesMapping { CategoriesMappingID = 3, CatID = 2, MapCatID = 3},
new CategoriesMapping { CategoriesMappingID = 4, CatID = 2, MapCatID = 4},
new CategoriesMapping { CategoriesMappingID = 5, CatID = 5, MapCatID = 6},
new CategoriesMapping { CategoriesMappingID = 6, CatID = 5, MapCatID = 7},
new CategoriesMapping { CategoriesMappingID = 7, CatID = 5, MapCatID = 10},
new CategoriesMapping { CategoriesMappingID = 8, CatID = 5, MapCatID = 11},
new CategoriesMapping { CategoriesMappingID = 9, CatID = 2, MapCatID = 12},
new CategoriesMapping { CategoriesMappingID = 10, CatID = 3, MapCatID = 13},
new CategoriesMapping { CategoriesMappingID = 11, CatID = 3, MapCatID = 14}
};
How can i get the last nodes of a specific CatID for example on the above code, if i choose CatID = 2 it should only bring back CatIDs 4,12,13,14. It should not return its sub-category CatID 3 because it also has nodes within which are 13 & 14. Rather it return the child-nodes of CatID 3 only.