C
C#11mo ago
SWEETPONY

why do we need IAsyncDisposable here?

I found this and I don't understand why author use IAsyncDisposable instead of IDisposable. Can someone help me to understand?
/// <summary>
/// The context in which the WebAuthn operation is being processed.
/// </summary>
public interface IWebAuthnContext : IAsyncDisposable
{
/// <summary>
/// The context of the HTTP request in which the WebAuthn operation is being processed.
/// </summary>
public HttpContext HttpContext { get; }

/// <summary>
/// Save the changes made in this context.
/// </summary>
/// <param name="cancellationToken">Cancellation token for an asynchronous operation.</param>
Task CommitAsync(CancellationToken cancellationToken);
}
/// <summary>
/// The context in which the WebAuthn operation is being processed.
/// </summary>
public interface IWebAuthnContext : IAsyncDisposable
{
/// <summary>
/// The context of the HTTP request in which the WebAuthn operation is being processed.
/// </summary>
public HttpContext HttpContext { get; }

/// <summary>
/// Save the changes made in this context.
/// </summary>
/// <param name="cancellationToken">Cancellation token for an asynchronous operation.</param>
Task CommitAsync(CancellationToken cancellationToken);
}
2 Replies
SWEETPONY
SWEETPONYOP11mo ago
also why property has modifier?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server