I've a Dictionary<MyEntity1, IList<MyEntity2>> and I have an object of MyEntity2 which I know it is in one (and only one) of the lists of the dictionary (I've even seen it while debugging). How ever the following query is returning null:
IDictionary<MyEntity1, IList<MyEntity2>> myDictionary = new Dictionoary<MyEntity1, IList<MyEntity2>>();
MyEntity1 myEntity1 = (from p in myDictionary
where p.Value.Contains(myEntity2)
select p.Key) as MyEntity1;
What am I doing wrong?