Hi there,
I've spent hours with this but haven't managed...
Please see example below - How can this be done?
The idea is to build a compiled expression of type Func<dynamic, dynamic>
given an Expression<Func<T1,T2>>
passed by the class' consumer. I have been able to solve this problem (thanks to SO) IF the types T1 and T2 are known at design time. But I'm looking for a solution for the case in which T1 and T2 are NOT known at design time.
Is this possible?
Thanks a lot!
public class ExpressionExample
{
private Func<dynamic, dynamic> _compiledExpression;
public ExpressionExample(LambdaExpression lambdaExpression)
{
// How does one get a compiled expression of type
// Func<dynamic, dynamic> at this point given lambdaExpression?
}
}