Namoshek/DataTables.NetStandard

Ordering by expression which is used directly

nino-s opened this issue · 2 comments

There are two different possibilities to set the ordering property:

  • Default -> Property name is taken
  • ColumnOrderingProperty -> Property name is taken

In both scenarios the property name is taken for the OrderBy in

var propertyName = c.ColumnOrderingProperty != null
? c.ColumnOrderingProperty.GetPropertyPath()
: c.PrivatePropertyName;
queryable = (IDataTablesQueryable<TEntity, TEntityViewModel>)queryable.OrderBy(propertyName, c.OrderingDirection, c.OrderingCaseInsensitive, alreadyOrdered);

Isn't it possible to set a real expression, which is directly parsed as OrderBy? With this feature it would be possible to set more complex ordering logic.

Solved in #6! Will publish a release soon.

Perfect, ty. I will test it soon!