verdie-g / StoredProcedureEFCore

Entity Framework Core extension to execute stored procedures
MIT License
192 stars 44 forks source link

Cannot cancel #14

Closed IlyaTsilikovRAFrame closed 5 years ago

IlyaTsilikovRAFrame commented 6 years ago

I see IStoredProcBuilder.ExecNonQueryAsync (), etc. without CancellationToken parameter. Ability to cancel is often important.

verdie-g commented 6 years ago

I think you cancel like that :

var cts = new CancellationTokenSource();
Task t = ctx.LoadStoredProc("").ExecNonQueryAsync();
ctx.Wait(cts.Token);

Is it important to add a CancellationToken to the api ?

IlyaTsilikovRAFrame commented 6 years ago

I think it's important 'cause such or similar way I can just cancel call awaiting but not a procedure execution itself. But the embedded command cancellation can cancel also a procedure execution.