title: Why is there a difference between using a lambda in a where extension method an using a func in a where extension method
body: <p>I'm reading programming entity framework by Julia Lerman 2nd edition 
  I have a question about example 3-5 page 63</p>
  
  <p>the code in the book</p>
  
  <pre><code>IEnumerable&lt;Contact&gt; contacts5 = context.Contact.Where(c =&gt; c.FirstName == "Robert").OrderBy(foo =&gt; foo.LastName);
  
  foreach (Contact contact in contacts5)
  {
      Console.WriteLine("De voornaam is {0} en de achternaam is {1} ", contact.FirstName.Trim(), contact.LastName);
  }
  </code></pre>
  
  <p>results as expected</p>
  
  <p>But when I try </p>
  
  <pre><code>Func&lt;Contact, bool&gt; whereDel = c =&gt; (c.FirstName == "Robert                                            ");
  Func&lt;Contact, bool&gt; whereDel1 = c =&gt; (c.FirstName == "Robert");
  Func&lt;Contact, string&gt; orderDel = foo =&gt; foo.LastName;
  IEnumerable&lt;Contact&gt; contacts6 = context.Contact.Where(whereDel).OrderBy(orderDel);
  
  foreach (Contact contact in contacts6)
  {
      Console.WriteLine("De voornaam is {0} en de achternaam is {1} ", contact.FirstName.Trim(), contact.LastName);
  }
  </code></pre>
  
  <p>I get the expected results only with WhereDel. For the predicate I copied one of the roberts from the datatable in the sample database. 
  With whereDel1 which is the same predicate as the lambda in the where clause in the example in the book I get an empty IEnumerable. 
  Anyone?</p>