C# Dapper QueryAsync to ValueTuple not mapping correctly

Viewed 1867

I'm doing the following query using dapper and C#7 ValueTuples (installed nuget):

await connection.QueryAsync<(int, Guid)>(
                $@"SELECT tenant, pid FROM Table 
                ORDER BY id
                OFFSET {skip} ROWS 
                FETCH NEXT {dbBatchSize} ROWS ONLY");

It returns a list of 0 and Guid.Empty.

If I use only int or only Guid it works ok

I also tried naming the ValueTuple according to the columns in the table:

await connection.QueryAsync<(int tenant, Guid pid)>("...")

Same result.

Anyone has any tip? Thanks in advance!

2 Answers
Related