I have below code in c# 4.0.
//Dictionary object with Key as string and Value as List of Component type object
Dictionary>
I would to it like this:
//Dictionary object with Key as string and Value as List of Component type object
Dictionary> dic = new Dictionary>();
//from each element of the dictionary select first component if any
IEnumerable components = dic.Where(kvp => kvp.Value.Any()).Select(kvp => (kvp.Value.First() as Component).ComponentValue("Dep"));
but only if it is sure that list contains only objects of Component class or children