I have a dictionary of the type:
IDictionary> my_dictionary
bar class looks like this:
cl
var new_dict = my_dictionary.Select(x => new KeyValuePair>( x.Key, x.Value .Where(y => y.IsValid) .ToList())) .Where(x => x.Value.Count > 0) .ToDictionary(x => x.Key, x => x.Value.AsReadOnly());