title: How do I build Expression Call for Any Method with generic parameter
body: <p>I'm just trying make the same expression like below using Linq.Expression:</p>
  
  <pre><code>Expression&lt;Func&lt;Organization, bool&gt;&gt; expression = @org =&gt; 
      @org.OrganizationFields.Any(a =&gt;
          a.CustomField.Name == field.Name &amp;&amp;
          values.Contains(a.Value));
  </code></pre>
  
  <p>In this example above I have an entity called Organization and it has a property called OrganizationsFields as IEnumerable and I want to find any occurrence that match with Any parameter expression.</p>
  
  <p>I just using the code below to generate expression dynamically:</p>
  
  <pre><code>string[] values = filter.GetValuesOrDefault();
  
  ParameterExpression parameter = Expression.Parameter(typeof(T), "org");
  Expression organizationFields = Expression.Property(parameter, "OrganizationFields");
  
  MethodInfo any = typeof(Enumerable)
     .GetMethods()
     .FirstOrDefault(a =&gt; a.Name == "Any" &amp;&amp; a.GetParameters().Count() == 2)
     .MakeGenericMethod(typeof(OrganizationField));
  
  Func&lt;OrganizationField, bool&gt; functionExpression = a =&gt;
      a.CustomField.Name == filter.Name &amp;&amp; values.Contains(a.Value);
  
  Expression functionParam = Expression.Constant(
      functionExpression,
      typeof(Func&lt;OrganizationField, bool&gt;));
  
  Expression call = Expression.Call(organizationFields, any, functionParam);
  
  return Expression.Lambda&lt;Func&lt;T, bool&gt;&gt;(call, parameter);
  </code></pre>
  
  <p>The problems occur when I call the method Expression.Call it throw an ArgumentExeption</p>
  
  <p>Can anyone help me?</p>
  
  <p>Regards</p>