akamsteeg / AtleX.HaveIBeenPwned

A fully async .NET Standard client library for the API of HaveIBeenPwned.com
https://www.nuget.org/packages/AtleX.HaveIBeenPwned/
MIT License
5 stars 0 forks source link

Mark public methods in (I)HaveIBeenPwnedClient without cancellation tokens as obsolete #65

Open akamsteeg opened 2 years ago

akamsteeg commented 2 years ago

Currently, all public methods in HaveIBeenPwnedClient have two versions: One with a CancellationToken and one without. In the modern .NET world, there's a big push to either requiring cancellation tokens (or a explicit CancellationToken.None when cancelling is not important) or have an optional parameter with the cancellation token with a default value.

I prefer being as explicit in code as possible so for vFuture I'd like to remove the methods without a cancellation token. That means that in coming v6.x/V7 upgrades, we must mark the methods in (I)HaveIBeenPwnedClient without a CancellationToken with an ObsoleteAttribute with an appropriate worded warning.

We must also update the IntelliSense docs on the methods with a CancellationToken that CancellationToken.None can be used to when cancellation is not required or a cancellation token source is not available.