title: Creating a distinct list of custom type in C#
body: <p>I receive a List of en entity framework type and want to only return the distinct values from the List. I'm using the following approach, however it's not uniquifying the list. Any suggestions?</p>
  
  <p>Param: <code>List&lt;Flag&gt; flags</code></p>
  
  <pre><code>List&lt;Flag&gt; distinctFlags = flags.Distinct().ToList();
  </code></pre>
  
  <p>The values of Flag are as follows: ID, Flag, FlagValue. Could I use linq in this instance?</p>
  
  <p>Thanks.</p>