15
If I have a CancellationTokenSource that is still in scope when I'm checking for cancellation -- e.g., if I've just made a database query and have not yet passed the CancellationToken down to Tasks to process the results -- should I access IsCancellationRequested from the source or from its token?
In other words, if both options are available, which is preferred, and why?
1:
myCancellationTokenSource.IsCancellationRequested
2:
myCancellationTokenSource.Token.IsCancellationRequested