title: Distinct a list with objects by id
body: <p>I have a program where there is a topic (like a forum), people can react to that topic. </p>
  
  <p>USER:</p>
  
  <ol>
  <li>id</li>
  <li>first name</li>
  <li>last name</li>
  </ol>
  
  <p>TOPIC:</p>
  
  <ol>
  <li>id</li>
  <li>subject</li>
  </ol>
  
  <p>REACTION:</p>
  
  <ol>
  <li>id</li>
  <li>topic_id</li>
  <li>content</li>
  </ol>
  
  <p>Code:</p>
  
  <pre><code>List&lt;USER&gt; ListOfAllUsers = new List&lt;USER&gt;();
  var AllReactions = from r in db.REACTIONs
                     where r.topic_id == _topic_id
                     select r;
  
  foreach (var itemX in AllReactions)
  {
      ListOfAllUsers.Add(itemX.USER);
  }
  
  //Distinct the list of duplicates
  var ListOfUsers = ListOfAllUsers.Distinct().ToList();
  </code></pre>
  
  <p>Now, the "distinct" list still has some duplicates, how do I distinct the list based on the user id's? Or maybe there is another better way to do this. Thanks in advance.</p>