title: Compare id's of objects in two lists and get the list of objects that includes objects with ids occurring in both of them
body: <p>I have struggled with it for a long time. I have two collections: MyRepository.All and MyCollection, both holds the collection of objects which has ID property. I need to get result of list of objects from MyRepository.All what contains only objects which id's are equal to MyCollection's objects'ids.</p>
  
  <p>ICollection MyCollection // as parameter to method</p>
  
  <pre><code>var result = MyRepository.All.Where(r=&gt;r.id==MyCollection.???.id).ToList();
  </code></pre>
  
  <p>i need to replace ??? with some linq to get this done.
  ive tried different where and select caluses, excist and intersect and so on..</p>