I have a dictionary of type Dictionary<int, double>
and want to eliminate values equal to a certain value.
At the moment I have
Dictionary <int, double> dict = GetDictionary();
dict = dict.Where(x => x.Value != 100).Select(x => x);
And am getting the error:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<int,double>>
' to 'System.Collections.Generic.Dictionary<int,double>
'. An explicit conversion exists (are you missing a cast?)
How can I achieve what I'm trying to do using Linq?