title: How to write SQL IsNull() in Linq?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/413084/equivalent-of-sql-isnull-in-linq">Equivalent of SQL ISNULL in LINQ?</a>  </p>
  </blockquote>
  
  
  
  <p>I am recently migrated from <code>ADO.Net</code> to <code>Entity Framework</code></p>
  
  <p>I have problem in executing this query in Linq</p>
  
  <pre><code>select IsNull(MAX(InvoiceNo),0) from Sales
  </code></pre>
  
  <p>I have written this query in LINQ except isNull()</p>
  
  <pre><code>        var q = (from p in dbContext.Sales
                   select p.InvoiceNo).Max();
  </code></pre>
  
  <p>But i dont know how to use <code>IsNull()</code> in this Linq</p>
  
  <p>When i execute this Linq Query I am getting this exception.</p>
  
  <blockquote>
    <p>'The invocation of the constructor on type
    'JIMS.ViewModel.Transaction.SalesViewModel' that matches the specified
    binding constraints threw an exception.' Line number '8' and line
    position '6'.</p>
  </blockquote>
  
  <p>I am using WPF MVVM FrameWork with Entity FrameWork as DAL</p>