要生成一个p=>p.FirstName的表达式,现在遇到一个问题
public static Expression<Func<T, Tkey>> OrderExpression<T,Tkey>(string property) { ParameterExpression para = Expression.Parameter(typeof(T), "u"); MemberExpression member = Expression.PropertyOrField(para, property); return Expression.Lambda<Func<T, Tkey>>(member, para); }
Expression<Func<MODEL.User, ****>> Ordery =null,
现在在****处要设定为 属性property的类型(如string,int,int?),求反射的写法,谢谢