Dapper: Missed CancellationToken for QueryAsync with an arbitrary number of input types

Created on 23 Jan 2019  路  5Comments  路  Source: StackExchange/Dapper

In methods QueryAsync with an arbitrary number of input types missed CancellationToken. In this methods initialized CommandDefinition with default(CancellationToken). CancellationToken should be moved to method parameters.

https://github.com/StackExchange/Dapper/blob/82a005953573b00b1d4c39e43568fb45449dd8e4/Dapper/SqlMapper.Async.cs#L974

api breaking-change

All 5 comments

We're experiencing the same problem. Would be better to add an overload that takes a CommandDefinition instead of sql string, as the rest of methods, but with the Type[]

We're racking up items for the 2.0 timeframe...adding cancellation tokens everywhere will be included. We have another big project in the pipe first (porting Stack Overflow to .NET Core), so I don't have a timeline. I just wanted to say: yes, this is planned.

Great, I'll be waiting for this change I need to add the cancellationToken to the queries so all the processes end smoothly.

Any progress on this issue?

It would help with this SqlKata issue:
https://github.com/sqlkata/querybuilder/issues/302

@NickCraver would you be willing to accept a PR with this change? If so, could we discuss what you had in mind?

Was this page helpful?
0 / 5 - 0 ratings