Looking at the documented overloads available for the Expression.Call(), method, I can find the following overloads to obtain an expression node that will perform a call to an instance method expecting:

  1. no arguments
  2. two arguments
  3. three arguments
  4. four arguments
  5. variable arguments via an Expression array
  6. variable arguments via an IEnumerable<Expression>

What would be the rationale for not having an overload expecting a single argument?

In my mind, the method signature for the single argument case would be:

public static MethodCallExpression Call(
    Expression instance,
    MethodInfo method,
    Expression arg0);

I don't see any other overloads that would collide with this method signature, so I really don't get why the method is missing. I understand that the overloads expecting an array or an IEnumerable would allow me to create an Expression for the single-argument case, but that would also apply to the other available overloads so I am curious if there is something I don't see that would explain why this overload is missing.

0

There are 0 answers