I have some async code that I would like to add a CancellationToken to. However, there are many implementations where this is not needed so I would like to have a d
CancellationToken
Another option is to use a Nullable parameter, default it to null, and deal with it inside the method:
Nullable
null
Task DoStuff(...., CancellationToken? ct = null) { var token = ct ?? CancellationToken.None; ... }