Perhaps this is not of interest to you, but I thought that I would send an answer anyway:
I use Linq2Sql and an ObjectDataSource object, and it performs paging and sorting very well.
I implemented a class that will be used as an ObjectDataSource object. It has a Select and Count method, calling my business layer, which uses Linq2SQL queries to retrieve data from a database, should look like EntityFramework. Selection methods automatically get the first index, page size, and sort expression.
public List<EntityClass> Select(int startIndex, int pageSize, string sortBy) {} public int Count() {}
In ASPX, the DataSource is configured as follows:
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="Select" EnablePaging="true" StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SortParameterName="sortBy" SelectCountMethod="Count" > </asp:ObjectDataSource>
The Select and Count method uses Linq queries to retrieve data from the database. I use the Skip (), Take (), and Orderby () methods . For OrderBy, to use the string sort expression, I use DynamicLinq . Code coding, data processing, paging and sorting do not work.
If you're interested, I can post more details about my code.
source share