Ignore CancellationToken parameters by default
See original GitHub issueI can’t find a way to flag a parameter on my method to exclude the CancellationToken
parameter from generating in the documentation.
I propose a convention of ignoring this type of parameter during generation.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Ignore CancellationToken parameters by default · Issue #627
I can't find a way to flag a parameter on my method to exclude the CancellationToken parameter from generating in the documentation.
Read more >c# - Default parameter - CancellationToken
It's a good idea to only make your CancellationToken parameters optional in your public API (if you have one) and leave them as...
Read more >CA1068: CancellationToken parameters must come last
A method has a CancellationToken parameter that is not the last parameter. By default, this rule analyzes the entire codebase, ...
Read more >Set default parameter value for cancellationToken
This parameter allows you to check if a cancellation is requested and to handle this properly. Tip: If you want to learn everything...
Read more >A Deep Dive into C#'s CancellationToken | by Mitesh Shah
Here we start cancellable tasks and pass the cancellation token to the delegate that's running. Passing to the task here is optional.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Finally found out why my controller wasn’t working and this was it - just spent all weekend trying to get this going.
If you are using swashbuckle v6 and ASP.NET 5 then the code you need differs slightly from the above sample.
The code below was what I had to use to get things going…
Fixed by 7ab9b842c5ad068dd7115a102bed45559133e0a6. Will automatically ignore parameters of type CancellationToken without the need for custom filters.