private bool TryCreateImplicitSorting( PropertyInfo property, out SortFieldDefinition definition) { if (typeof(IComparable).IsAssignableFrom(property.PropertyType)) { var field = new SortFieldDescriptor(Context, property); definition = field.CreateDefinition(); return(true); } definition = null; return(false); }
public ISortFieldDescriptor Sortable( Expression <Func <T, IComparable> > property) { if (property.ExtractMember() is PropertyInfo p) { var field = new SortFieldDescriptor(Context, p); Fields.Add(field); return(field); } // TODO : resources throw new ArgumentException( "Only properties are allowed for input types.", nameof(property)); }