public void aMethod<T>(Expression<Func<T, object>> lambda)
{
......
}
aMethod<User>(x=> x.UserId)
User is my custom class, members of his UserId int type...
I want the lambda expression x => x.UserId
But in the way, I get is x => Convert (x.UserId)
Therefore, the following operations can not, I need to ensure that my expression type Expression <Func <T, object>>
it is not defined as Expression <Func <T, int>>
Is there any way it?