title: EF DataContext: Code is being executed so long
body: <p>I have the following property in dataContext:</p>
  
  <pre><code>    public DbSet&lt;CollectionSite&gt; CollectionSites { get; set; }
  </code></pre>
  
  <p>where <code>CollectionSite</code> has approx 30-40 properties.</p>
  
  <p>I try the following code:</p>
  
  <pre><code>        var query = _context.CollectionSites
              .Where(cs =&gt;
              cs.IsActive &amp;&amp;
              cs.OpenToPublic &amp;&amp;
              (NIDACollections == null || cs.NIDACollections == NIDACollections.Value) &amp;&amp;
              (SAPCollections == null || cs.SAPCollections == SAPCollections.Value) &amp;&amp;
              (observedRequested == null || cs.ObservedCollection == observedRequested.Value) &amp;&amp;
              (electronicCC == null || cs.RegulatedElectronicCCF == electronicCC.Value) &amp;&amp;
              (alcoholTestType == null || cs.BreathAlcohol == alcoholTestType.Value))
              ;
  </code></pre>
  
  <p>where all these variables like <code>NIDACollections</code> etc are <code>bool?</code>.
  This code just created <code>IQueryable&lt;CollectionSite&gt;</code> object and don't execute a request to source, but this code is being executed 4-5 seconds (i7, 16Gb of RAM). Why so long? What is wrong in my code?</p>