Paymentsense / Dapper.SimpleLoad

Dapper.SimpleLoad
MIT License
13 stars 4 forks source link

Add Support for Paging Results #23

Closed tuxford1 closed 6 years ago

tuxford1 commented 6 years ago

To efficiently allow the display of large sets of data, Dapper.SimpleLoad needs support for the paging of result-sets within the database. TSQL supports several options for the paging of results. A simple method is to use the OFFSET FETCH clause, e.g.:

SELECT * FROM myTable ORDER BY SortColumn DESC OFFSET @offset ROWS FETCH NEXT @fetch ROWS ONLY

This enhancement request is to add support in Dapper.SimpleLoad for the following (or equivalent) parameters when executing a query:

Ideally support would be added for multiple levels of sorting. Dapper.SimpleLoad currently supports a desiredNumberOfResults parameter that restricts the number of rows a query returns using a TOP clause. It might be possible and desirable to overload this parameter to act as the Fetch parameter described above.