I am trying to use LINQ to extract some data from a dictionary.
var testDict = new Dictionary<int, string>(); testDict.Add(1, "Apple"); testDict.Add(2, "Cherry"); var q1 = from obj in testDict.Values.Where(p => p == "Apple"); var q2 = from obj in testDict.Where(p => p.Value == "Apple");
The above lines, q1 and q2, lead to a compiler error.
error CS0742: A query body must end with a select clause or a group clause
How do I use LINQ to find values ββin a dictionary?
Thanks,
Rick
c # lambda linq
rboarman
source share