title: How to find duplicate ids from list in c#
body: <p><strong>I want to filter duplicate id from a list using **<code>linq</code></strong>, here is the code:**</p>
  
  <pre><code>foreach (var item in _VMReturnStock.scmDistReturnDetails.ToList())
  { 
  
  }
  </code></pre>
  
  <p><strong>I have ids in <code>scmDistReturnDetails</code></strong>, what should I do in this case?  And on the basis of duplicate id I have to set model state false.**</p>