Error Expression.Call () to call an instance method that expects a single argument. Is there a reason for this?

By looking at the documentary overloads available for the Expression.Call(), method, I can find the following overloads to get a node expression that will invoke an instance method that is waiting:

  • no argument
  • two arguments
  • three arguments
  • four arguments
  • variable arguments through an Expression array
  • variable arguments via IEnumerable<Expression>

What would be the reason for the lack of overload waiting for one argument?

In my opinion, the method signature for the case with one argument will be:

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

I do not see any other overloads that might run into this method signature, so I really don't understand why this method is missing. I understand that overloads expecting an array or IEnumerable would allow me to create Expression for the case with one argument, but this also applies to other available overloads, so I'm curious if there is anything that explains why this overload is missing.

+6
source share

Source: https://habr.com/ru/post/1013365/


All Articles