It seems like that when #418 was fixed, it was missed that it needs to be fixed in the file SqlMapperExtensions.Async.cs too.
@johandanforth commited the fix for the non async file.
This is crazy stupid to still be around two years after initially reported. @cremor can you also update the description to better reflect the full issue. Personally I think #418 was the wrong approach, instead tolist should be used on the source functions (ie KeyPropertiesCache) no matter what (right now if not cached it returns the official list). I know this is undergoing refactor plans but this is a crazy bug to track down and should have been fixed faster especially given how easy.
@mitchcapper While I don't use Dapper in an active project any more, I agree that this easy fix should have been released long ago. The large amount of issues and pull requests that were created for it also show that it affects many users: #530 (this issue), #533, #703, #704, #793, #956 (maybe more)
I also agree that ToList
should be in the function itself, as I've already written in https://github.com/StackExchange/Dapper/pull/533#issuecomment-225795117. I've even implemented this in my own fork in https://github.com/cremor/dapper-dot-net/commit/9678b05166a3acb14c496a8b3f2b23a1a5f727cb#diff-e89382e2c70188b8cf8748d3e1db8f61
Yes #704 is the way to go (although good remove the tolist added from #418).
So this is solved with #1048 but still not released. Maybe @NickCraver can enlight us?
1.50.7 is now released
@mgravell but Dapper.Contrib has not been released yet?
Most helpful comment
@mitchcapper While I don't use Dapper in an active project any more, I agree that this easy fix should have been released long ago. The large amount of issues and pull requests that were created for it also show that it affects many users: #530 (this issue), #533, #703, #704, #793, #956 (maybe more)
I also agree that
ToList
should be in the function itself, as I've already written in https://github.com/StackExchange/Dapper/pull/533#issuecomment-225795117. I've even implemented this in my own fork in https://github.com/cremor/dapper-dot-net/commit/9678b05166a3acb14c496a8b3f2b23a1a5f727cb#diff-e89382e2c70188b8cf8748d3e1db8f61