DapperLib / Dapper

Dapper - a simple object mapper for .Net
https://www.learndapper.com/
Other
17.57k stars 3.68k forks source link

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

Closed Dot-H closed 1 month ago

Dot-H commented 1 month ago

It seems like QueryAsync when being passed the map and splitOn argument ends up ignoring the NoCache command flag.

You can see https://github.com/DapperLib/Dapper/pull/2112 for a repro

Dot-H commented 1 month ago

Not sure what the best fix is TBH. Issue clearly comes from the CommandDefinition.ForCallback call here which doesn't pass on the CommandFlags.

But I am not sure why it's done that way. This ForCallback method seems to be here to ensure that the inner command only contains parameters of type DynamicParameters. I am not sure if it matters to also remove all the other attributes (including the Flags).