Add netstandard2.0 support (#33)

* Add netstandard2.0 support
This commit is contained in:
Stephen Toub 2025-03-07 14:46:40 -05:00 • committed by GitHub
commit 9c597aad90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,17 @@
using System.Text;
namespace System.Threading.Tasks;
internal static class CancellationTokenSourceExtensions
{
public static Task CancelAsync(this CancellationTokenSource cancellationTokenSource)
{
if (cancellationTokenSource is null)
{
throw new ArgumentNullException(nameof(cancellationTokenSource));
}
cancellationTokenSource.Cancel();
return Task.CompletedTask;
}
}