My question is not duplicate as the one that you have marked is searching List
and I am trying to search Dictionary
.
I have a Dictionary<string, Player>
.
Player
is an object with the properties GameID, Index
and more. My dictionary key is player's index
. I want to check if dictionary contains two Player
s with same GameID
(the index
will be different for those). One way of doing this is iterating with foreach
over dictionary values and use an variable which would be incremented every time it encounters certain GameID
. But I was wondering if there is a way to do this by using linq
? If there is, that solution would probably be better.