Interface IOpenIddictScopeCache<TScope>
- Namespace
- OpenIddict.Abstractions
- Assembly
- OpenIddict.Abstractions.dll
Provides methods allowing to cache scopes after retrieving them from the store.
public interface IOpenIddictScopeCache<TScope> where TScope : class
Type Parameters
TScope
The type of the Scope entity.
Methods
AddAsync(TScope, CancellationToken)
Add the specified scope to the cache.
ValueTask AddAsync(TScope scope, CancellationToken cancellationToken)
Parameters
scope
TScopeThe scope to add to the cache.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
FindByIdAsync(string, CancellationToken)
Retrieves a scope using its unique identifier.
ValueTask<TScope?> FindByIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifier
stringThe unique identifier associated with the scope.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TScope>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the scope corresponding to the identifier.
FindByNameAsync(string, CancellationToken)
Retrieves a scope using its name.
ValueTask<TScope?> FindByNameAsync(string name, CancellationToken cancellationToken)
Parameters
name
stringThe name associated with the scope.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TScope>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the scope corresponding to the specified name.
FindByNamesAsync(ImmutableArray<string>, CancellationToken)
Retrieves a list of scopes using their name.
IAsyncEnumerable<TScope> FindByNamesAsync(ImmutableArray<string> names, CancellationToken cancellationToken)
Parameters
names
ImmutableArray<string>The names associated with the scopes.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TScope>
The scopes corresponding to the specified names.
FindByResourceAsync(string, CancellationToken)
Retrieves all the scopes that contain the specified resource.
IAsyncEnumerable<TScope> FindByResourceAsync(string resource, CancellationToken cancellationToken)
Parameters
resource
stringThe resource associated with the scopes.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TScope>
The scopes associated with the specified resource.
RemoveAsync(TScope, CancellationToken)
Removes the specified scope from the cache.
ValueTask RemoveAsync(TScope scope, CancellationToken cancellationToken)
Parameters
scope
TScopeThe scope to remove from the cache.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.