ILookup<string, string> someList;
Cricket Sachin
Dravid
Dhoni
Football Beckham
Ronaldo
Maradona
Run Code Online (Sandbox Code Playgroud)
bool status = someList.Where(x => x.Key == "Football").Where( y => y.Value == "Ronaldo")
Run Code Online (Sandbox Code Playgroud)
应该回归真实
bool status = someList.Where(x => x.Key == "Football").Where( y => y.Value == "Venus williams")
Run Code Online (Sandbox Code Playgroud)
应该返回false
ILookup没有value属性,而不是循环,有没有更聪明的方法来获得几行结果.上面的代码是不对的,如果可能的话,希望有类似的东西.我是Linq的新手,所以学习更好的方法