Consider the following . . .
Dictionary<string, Dictionary<string, int>> myData;
I would like to keep only the outer entries where the inner int > 1.
myData= myData.Select(c => c.Value.Where(i => i.Value > 1));
. . . throws a conversion error.
Thanks.
EDIT
The answer @Saeed gave is doing great, but however I now need something additional. I need the outer Dictionary to only contain entries where the inner Dictionary has more than 1 entry. (Every time I think I’ve got it, I don’t. And I’m sure it something I should be seeing!)
You should cast it to dictionary, Also you can simply use anonymous type instead of its exact type.
Update: After doing this, for your additional requirement do: