1 public static Expression<Func<T, dynamic>> ToExpression<T>(this string value) 2 { 3 var property = typeof(T).GetProperty(value); 4 var parameter = Expression.Parameter(typeof(T), "p"); 5 var propertyAccess = Expression.MakeMemberAccess(parameter, property); 6 Func<T, dynamic> expression = Expression.Lambda<Func<T, dynamic>>(propertyAccess, parameter).Compile(); 7 }
上面是自己写的一半,后面就不知道怎样写啦,请各位大神帮助下