What would be the efficient way for finding and item in the list of type DirectoryItem as -
List<DirectoryItem> lstRootDirectory = GetAllRootLevelDirectories();
Each DirectoryItem has a Items (list of same type- DirectoryItem) and DirectoryItem is a struct as below:
struct DirectoryItem
{
public string AbsolutePath { get { return string.Format("{0}/{1}", BaseUri, Name); } }
public bool IsDirectory;
public string Name;
public List<DirectoryItem> Items;
}
In this case, what would be better approach to find-out an item from this kind of hierarchical list.