dapper: Get result and count at same time using QueryMultiple
From github example:
var sql = @"SELECT COUNT(*) FROM books
SELECT * FROM books ORDER BY bookID OFFSET 1000 ROWS FETCH NEXT 10 ROWS ONLY";
using(var multi = connection.QueryMultiple(sql))
{
var count = multi.Read<int>().Single();
var results = multi.Read<YourObject>().ToList();
}