title: How to return null value when using CopyToDataTable() LINQ extension method
body: <p>I am trying to return null value if there are no elements after executing my query, I am using DefaultIfEmpty() method, but it is not preventing from that exception to be thrown:</p>
  
  <blockquote>
    <p>Exception thrown: 'System.InvalidOperationException' in
    System.Data.DataSetExtensions.dll</p>
    
    <p>Additional information: The source contains a DataRow reference that
    is null.</p>
  </blockquote>
  
  <p>my code:</p>
  
  <pre><code>DataTable filtered = dt.AsEnumerable()
                         .Where(x =&gt; x.Field&lt;string&gt;("SLA") == "Valid" 
                                     &amp;&amp; x.Field&lt;string&gt;("Status") == "Finished")
                         .Select(y =&gt; y)
                         .DefaultIfEmpty()
                         .CopyToDataTable();
  </code></pre>
  
  <p>How can i return null value to <code>filtered</code> datatable? </p>