I'm using Dapper QueryMultiple/Query/Execute methods in my .net 4.5 code (Parallel library), I would like to know if it is thread safe.
Thank you,
Monica
All of the internal meta-programming parts of dapper should indeed be thread-safe, and it sees enough heavy load on sites like stackoverflow that I'm pretty confident this is fine.
However, if you perform multiple concurrent operations on the same connection instance - then that comes down to whether a single ADO.NET connection is thread-safe; and in most cases, no it is not, AFAIK. So: don't do that. Multiple connections with their own operations should be fine though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With