Example of GetMultiple(Async) method on QueryFactory
m4ss1m0g opened this issue · 0 comments
I see a method on QueryFactory
named GetMultiple
and the async variation GetMultipleAsync
but there are no docs about them, on the source code I can see that it is a wrapper around the QueryMultiple
of Dapper.
The method also has a generic T but it is not used, I successfully used the method by passing an int
on the T.
var result = await _db.GetMultipleAsync<int>(new Query[] { query1, query2, query3}, cancellationToken: cancellationToken);
Otherwise, it raises an error.
The type arguments for method 'QueryFactory.GetMultiple(Query[], IDbTransaction, int?, CancellationToken)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
Each query returns a complex object (not an int)
Is this the correct way to use the method?
There is another way to execute multiple queries in one single call to the DB?