I have the following code
IDictionary<string, IEnumerable<Control>>
I need to convert it to
IDictionary<string, IEnumerable<string>>
using ClientID as the new value.
Does anybody know how to do this in Linq instead iterating through the dictionary?
Thanks
Podge
Something like
IDictionary<string, IEnumerable<Control>> input = ...
IDictionary<string, IEnumerable<string>> output =
input.ToDictionary(item => item.Key,
item => item.Value.Select(control => control.ClientID));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With