Given a lambda that takes an Identification object, and returns a property:
Expression<Func<Identification, object>> fx = _ => _.Id;
And a conversion lambda that converts an object into an Identification instance:
ParameterExpression p = Expression.Parameter(typeof(object), "o");
Expression @new = Expression.Lambda(Expression.Convert(p, typeof(Identification)), p);
How do I build a new lambda that executes @new
(getting out the Identification Instance) and passes the result into fx
. I need @new
's result to bind to the first parameter of fx
somehow, and I cannot find an example.
I need the result to be an Expression
, it should be of type Expression<Func<object, object>>
and it should convert the inbound parameter to an Identification
and then get the Id
property.