Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.

$
0
0
You must use OrderBybeforeSelectPage.
grdAccountList.DataSource = 
    accountService.Query()
    .OrderBy(queryable => queryable.OrderBy(account => account.Id))
    .SelectPage(grdAccountList.PageIndex, grdAccountList.SettingsPager.PageSize, out _recordCount)
    .ToList();
A Consideration

This 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.

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>