title: Distinct the collection in Linq C#
body: <p>I have the  collection </p>
  
  <p>From the collection the column name ma_position_value  should not contain the same value  </p>
  
  <p>For Example</p>
  
  <p>If the collection have 5 records, The column  ma_position_value   should not contain the same value from all 5 records...but it can contain same value for 2 or 3 or 4 records from the collection Atleast one column value should change.</p>
  
  <p>So the main intension is ALL 5 records should not contain same value.Any one should get different value.So if all 5 is same I tried to throw a message </p>
  
  <p>So I have just write a bool to return it if it is change </p>
  
  <pre><code>bool lblMa = false;
  lblMa = ibusCalcWiz.iclbMssPaServiceSummary
          .Where(lbusMssPaServiceSummary =&gt; lbusMssPaServiceSummary.icdoSummary.ma_position_value.IsNotNullOrEmpty()).Distinct().Count() &gt; 1;
  </code></pre>
  
  <p>But it is always return true.</p>