Skip to content

Instantly share code, notes, and snippets.

View MattParkerDev's full-sized avatar

Matt Parker MattParkerDev

View GitHub Profile
@MattParkerDev
MattParkerDev / ConfigureAwaits.cs
Created August 3, 2025 04:17
Correct IAsyncDisposable.ConfigureAwait(false) usages
// 'using' statement
// if you don't need access to the CancellationTokenRegistration
await using (cancellationToken.Register(() => buildManager.CancelAllSubmissions()).ConfigureAwait(false))
{
// disposed outside this scope
}
// 'using' statement
// if you need access to the CancellationTokenRegistration
var test = cancellationToken.Register(() => buildManager.CancelAllSubmissions());