title: C# LINQ Where Predicate Type Arguments
body: <p>I have an XElement with values for mock data.  </p>
  
  <p>I have an expression to query the xml:</p>
  
  <pre><code>Expression&lt;Func&lt;XElement, bool&gt;&gt; simpleXmlFunction = 
      b =&gt; int.Parse(b.Element("FooId").Value) == 12;
  </code></pre>
  
  <p>used in:</p>
  
  <pre><code>var simpleXml = xml.Elements("Foo").Where(simpleXmlFunction).First();
  </code></pre>
  
  <p>The design time error is:</p>
  
  <p>The type arguments for method 'System.Linq.Enumerable.Where(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly'</p>
  
  <p>The delegate supplied to Where should take in an XElement and return a bool, marking if the item matches the query, I am not sure how to add anything more to the delegate or the where clause to mark the type.</p>
  
  <p>Also, the parallel method for the real function against the Entity Framework does not have this issue.  What is not correct with the LINQ-to-XML version?</p>