title: Linq, Where Extension Method, Lambda Expressions, and Bool's
body: <p>Greetings, I am having some issues with using a bool operation within a Where clause extension method of an IQueryable object obtained using Linq to Entities.  The first example is showing what does work using Bool1 as the operation I need to move to a where clause extension method.  The second example is what doesn't work after the change. Bool1 is is completely ignored and doesn't impact the results.</p>
  
  <p>Example 1:</p>
  
  <pre><code>var results =
       from a in context.aTable1
       where a.Bool1 == false &amp;&amp; a.Bool2  == false
       select new
       {
             Column1 = a.Column1
             Bool1 = a.Bool1
             Bool2 = a.Bool2
       };
  
  results.Where(l =&gt; l. Column1.Contains(fooString));
  </code></pre>
  
  <p>Example 2:</p>
  
  <pre><code>var results =
       from a in context.aTable1
       where a.Bool2  == false
       select new
       {
             Column1 = a.Column1
             Bool1 = a.Bool1
             Bool2 = a.Bool2
       };
  
  results.Where(l =&gt; l.Bool1 == false);
  results.Where(l =&gt; l. Column1.Contains(fooString));
  </code></pre>
  
  <p>These are over simplified examples, however I hope they show what I am trying to do.  The where extension methods are in a different method and are the reason they cannot be done when I am creating the original query.  </p>
  
  <p>I have tried the following other ways of doing the same thing with that where clause:</p>
  
  <pre><code>results.Where(l =&gt; !l.Bool1);
  results.Where(l =&gt; l.Bool1.Equals(false));
  </code></pre>
  
  <p>They have the same effect which is nothing.</p>