如何从Dynamic Linq获取最大值?
public Func<TSource, T> DynamicMax<TSource, T>(string fieldName, object className)
{
var type = typeof(TSource);
var pe = Expression.Parameter(type, "p");
var propertyReference = Expression.Property(pe, fieldName);
var constantReference = Expression.Constant(className);
return Expression.Lambda<Func<TSource, T>>
(Expression.IsTrue(propertyReference, constantReference), pe).Compile();
}