public void do_override_sorting_if_no_sorting_exists() { var rule = SortRule <Case> .Ascending(x => x.Condition); var request = new GridDataRequest() { SortColumn = null, SortAscending = false }; rule.ApplyDefaultSorting(request); request.SortColumn.ShouldEqual("Condition"); request.SortAscending.ShouldBeTrue(); }
public void do_not_override_sorting_if_it_exists() { var rule = SortRule <Case> .Ascending(x => x.Condition); var request = new GridDataRequest() { SortColumn = "different", SortAscending = false }; rule.ApplyDefaultSorting(request); request.SortColumn.ShouldEqual("different"); request.SortAscending.ShouldBeFalse(); }
public void SortAscending(Expression <Func <TEntity, object> > property) { _definition.SortBy = SortRule <TEntity> .Ascending(property); }