Reputation: 379
I use Expression.Call
to build MethodCallExpression dynamically. The call is for "First" method.
Then, I need to wrap it to Expression<Func<x,y>>
(x and y are types, and it irrelevant to the question). I'm trying to do it with Expression.Lambda<Func<x,y>>
, but get Incorrect number of parameters supplied for lambda declaration
exception when passing
new ParameterExpression[]{}
(i.e. empty array) in the ParameterExpression[] input parameter.
what should be provided to Expression.Lambda
when the Lambda takes ZERO parameters?
Upvotes: 2
Views: 468