Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of GetMultiple(Async) method on QueryFactory #661

Open
m4ss1m0g opened this issue Feb 6, 2023 · 0 comments
Open

Example of GetMultiple(Async) method on QueryFactory #661

m4ss1m0g opened this issue Feb 6, 2023 · 0 comments

Comments

@m4ss1m0g
Copy link

m4ss1m0g commented Feb 6, 2023

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?

Source code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant