You must use
This implicit behaviour is not very intuitive. Since
OrderBy
beforeSelectPage
. grdAccountList.DataSource =
accountService.Query()
.OrderBy(queryable => queryable.OrderBy(account => account.Id))
.SelectPage(grdAccountList.PageIndex, grdAccountList.SettingsPager.PageSize, out _recordCount)
.ToList();
A ConsiderationThis implicit behaviour is not very intuitive. Since
SelectPage
performs a Skip
and OrderBy
must be called before the method Skip
, SelectPage
should ensure an OrderBy
has already been established. Ideally, SelectPage
should only be avaliable after an OrderBy
has been used in the method chaining.