title: Internal .NET Framework Data Provider error 1025
body: <pre><code>IQueryable&lt;Organization&gt; query = context.Organizations;
  
  Func&lt;Reservation, bool&gt; predicate = r =&gt; !r.IsDeleted;
  
  query.Select(o =&gt; new { 
      Reservations = o.Reservations.Where(predicate)
  }).ToList();
  </code></pre>
  
  <p>this query throws "Internal .NET Framework Data Provider error 1025" exception but the query below does not.</p>
  
  <pre><code>query.Select(o =&gt; new { 
      Reservations = o.Reservations.Where( r =&gt; !r.IsDeleted)
  }).ToList();
  </code></pre>
  
  <p>I need to use the first one because I need to check a few if statements for constructing the right predicate. I know that I can not use if statements in this circumstance that is why I pass a delegate as parameter.</p>
  
  <p>How can I make the first query work?</p>