Dapper pass CancellationToken to stored proc

To pass a CancellationToken to dapper, create a “CommandDefinition`

Snippet

await conn.QueryAsync(new CommandDefinition(procedure, p, commandType: CommandType.StoredProcedure, cancellationToken: cancellationToken));

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.