title: Are you missing a using directive or an assembly reference? Entity framework Distinct Function
body: <p>I have requirement in which i just want to return List of Unique Vendor ID based on Service Status, Done/No;</p>
  
  <pre><code>Select Distinct(vendorid) FROM DC_System_Assets where ServiceStatus='Done'
  </code></pre>
  
  <p>I tried to write like that but it's getting error.</p>
  
  <pre><code>public List&lt;int&gt; AutoScheduleMails()
  {
      var v = db.DC_System_Assets.Select(f =&gt; f.VendorId).Distinct().Where(p =&gt; p.ServiceStatus == "Done").ToList();
  }
  </code></pre>
  
  <blockquote>
    <p>'System.Nullable' does not contain a definition for
    'ServiceStatus' and no extension method 'ServiceStatus' accepting a
    first argument of type 'System.Nullable' could be found (are you
    missing a using directive or an assembly reference?)</p>
  </blockquote>