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

🐛 [QueryAsync] NoCache flag ignored when doing MultiMap #2112

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dot-H
Copy link

@Dot-H Dot-H commented Sep 17, 2024

As the AssertNoCacheWorksForMultiMap tests shows, when the QueryAsync method is passed a splitOn and map arguments, the NoCache flag is actually ignored.

The issue seems to come from here

Signed-off-by: Alexandre Bernard <[email protected]>
Signed-off-by: Alexandre Bernard <[email protected]>
Comment on lines +1013 to +1014
await MarsConnection.QueryAsync<int, int, (int, int)>(cmdDef, splitOn: "b", map: (a, b) => (a, b));
Assert.Equal(0, SqlMapper.GetCachedSQLCount());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails. SqlMapper.GetCachedSQLCount() actually returns 1

Assert.Equal(0, before);

await MarsConnection.QueryAsync<(int, int)>(cmdDef);
Assert.Equal(0, SqlMapper.GetCachedSQLCount());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this pass

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

Successfully merging this pull request may close these issues.

1 participant