KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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
Tags (comma-separated)
Save Edits
Cancel