title: Expression creation on instance method without instance
body: <p>I have a generic class that has a method 'Call' on it with a generic return type and a lambda expression as a parameter.  This has to be generated with reflection, and since the types are unknown, I need to create the lambda expression the long way.  I have a working solution listed below, but I do not like having to get the instance out of the generic class since it is private and does some logic on a retrieve. </p>
  
  <p>Class: </p>
  
  <pre><code>public class Proxy&lt;T&gt;
  {
      public TR Call&lt;TR&gt;(Func&lt;T, TR&gt; serviceInvoke)
      private T Instance
  }
  </code></pre>
  
  <p>Reflection Usage:</p>
  
  <pre><code>var serviceInstance = proxy.GetType().GetProperty("Instance", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(proxy, null);
  var serviceMethod = type.GetMethod(rule.ServiceMethodName);
  var parameters = serviceMethod.GetParameters().Select(parameterInfo =&gt; PropertyChainNavigator.GetValueForPropertyChain(((string)rule.Parameters[parameterInfo.Name]).Split(new[] { '.' }), context)).ToArray();
  var thisParam = Expression.Constant(serviceInstance);
  var valueParams = parameters.Select(Expression.Constant).ToList();
  var call = Expression.Call(thisParam, serviceMethod, valueParams);
  var func = Expression.Lambda(call, Expression.Parameter(type)).Compile();
  var callMethod = proxy.GetType().GetMethods().Where(x =&gt; x.Name == "Call" &amp;&amp; x.ReturnType != typeof(void)).First().MakeGenericMethod(serviceMethod.ReturnType);
  result = callMethod.Invoke(proxy, new[] { func });
  </code></pre>
  
  <p>Normal Usage:</p>
  
  <pre><code>var proxy = new Proxy&lt;ITestClass&gt;();
  proxy.Call(x =&gt; x.Method);
  </code></pre>
  
  <p>I have tried to change the Expression.Call to not take an instance, but that only works on static methods. Does anyone know of a way for me to create the call, turn it into an lambda and have it compile without erroring</p>