title: Operator '&&' cannot be applied to operands of type 'lambda expression' and 'lambda expression
body: <p>I want to retrive all the records that have the IP or MAC addresses or if any of these are Null, so i wrote my method as follow:-</p>
  
  <pre><code>public IQueryable&lt;Technology&gt; AdvanceSearch(string ip = null, string mac = null, int techtype) 
          {
              var relatedresourcesID = entities.NetworkInfoes
                  .Where((a =&gt; String.IsNullOrEmpty(ip) || a.IPADDRESS.StartsWith(ip)))
                  .Where(a2 =&gt; String.IsNullOrEmpty(mac) || a2.MACADDRESS.StartsWith(mac)).Select(a3=&gt;a3.WORKSTATIONID);
  //code goes here
  </code></pre>
  
  <p>but i am not sure how will EF transalte the .where ; will it apply the second .Where() only after applying the first .Where clause ?</p>
  
  <p>second question, how i can apply all the checks to be inside one .Where()??</p>
  
  <p>I have tried to re-write my method as follow:-</p>
  
  <pre><code>var relatedresourcesID = entities.NetworkInfoes
                  .Where((a =&gt; String.IsNullOrEmpty(ip) || a.IPADDRESS.StartsWith(ip)) &amp;&amp; (a2 =&gt; String.IsNullOrEmpty(mac) || a2.MACADDRESS.StartsWith(mac)) )
                  .Select(a3=&gt;a3.WORKSTATIONID);
  </code></pre>
  
  <p>but i will get the following error :- </p>
  
  <blockquote>
    <p>Error 18  Operator '&amp;&amp;' cannot be applied to operands of type 'lambda
    expression' and 'lambda
    expression'   C:\Users\Administrator\documents\visual studio
    2012\Projects\TMS\TMS\Models\Repository.cs    914 24  TMS</p>
  </blockquote>