title: Expression.Call with generic types
body: <p>The class tester is trying to call sum on a generic queryable.  It breaks on the MethodCallExpression.  So I'm not sure if the line below will actually run either.  </p>
  
  <p>I've also tried to break out getting the MethodInfo in a separate call but it always returns null.  So I believe finding the "Sum" function with the arguments I have supplied is the trouble.  Any help is greatly appreciated.  </p>
  
  <pre><code>    class test
      {
          public int sumMe { get; set; }
      }
      [TestMethod]
      public void foo()
      {
  
          var list = new List&lt;test&gt;();
          list.Add(new test() { sumMe = 1 });
          list.Add(new test() { sumMe = 2 });
          list.Add(new test() { sumMe = 3 });
  
          tester.run(list.AsQueryable(), "sumMe");
  
      }
  
      class tester
      {
          public static void run&lt;TSource&gt;(IQueryable&lt;TSource&gt; source, string field)
          {
              ParameterExpression instance = Expression.Parameter(typeof(TSource), "x");
              MemberExpression propertyOnInstance = Expression.PropertyOrField(instance, field);
  
              Type typeOfGenericFunction = typeof(Func&lt;,&gt;).MakeGenericType(typeof(TSource), typeof(int));
              LambdaExpression lambda = Expression.Lambda(typeOfGenericFunction, propertyOnInstance, instance);
  
              MethodCallExpression expr = Expression.Call(typeof(Queryable), "Sum", new Type[] { typeof(TSource) }, propertyOnInstance, lambda);
              var hopingThisWorks = source.Provider.CreateQuery&lt;TSource&gt;(expr);
  
          }
      }
  </code></pre>