You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When paging queried data, we often need to know the totalt count of the filtered data before paging.
The straight-forward approach causes two roundtrips to the database. One for the data one for the count.
In Dapper, this is easily achievable using QueryMultiple.
On Stackoverflow I have only found very old or low quality answers, with solutions that are hacky at best. Chat-GPT provides broken answers. Would be great if you could provide an authoritative answer. This specific article on paging seems an ideal location.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 14420c94-0cae-1648-b734-633a1cac6624
Version Independent ID: 14420c94-0cae-1648-b734-633a1cac6624
The main issue for batching multiple queries is dotnet/efcore#10879 that would be the analog to Dapper's QueryMultiple; unfortunately there isn't a great way to achieve that at the moment. It may be possible to fake it by folding the two queries into one, but I don't have an example ready (and it would probably mostly be a hack).
When paging queried data, we often need to know the totalt count of the filtered data before paging.
The straight-forward approach causes two roundtrips to the database. One for the data one for the count.
In Dapper, this is easily achievable using
QueryMultiple
.On Stackoverflow I have only found very old or low quality answers, with solutions that are hacky at best. Chat-GPT provides broken answers. Would be great if you could provide an authoritative answer. This specific article on paging seems an ideal location.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: