I\'m using Dapper 1.31 from Nuget. I have this very simple code snippet,
string connString = \"\"; string query = \"\"; int val = 0; CancellationTokenSource
try using a SqlConnection and catch the exception on cancel
SqlConnection
var sqlConn = db.Database.Connection as SqlConnection; sqlConn.Open(); _cmd = new SqlCommand(textCommand, sqlConn); _cmd.ExecuteNonQuery();
and cancel the SqlCommand
SqlCommand
_cmd.Cancel();