Table of Contents

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 TScope

The scope to add to the cache.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask

A ValueTask that can be used to monitor the asynchronous operation.

FindByIdAsync(string, CancellationToken)

Retrieves a scope using its unique identifier.

ValueTask<TScope?> FindByIdAsync(string identifier, CancellationToken cancellationToken)

Parameters

identifier string

The unique identifier associated with the scope.

cancellationToken CancellationToken

The 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 string

The name associated with the scope.

cancellationToken CancellationToken

The 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 CancellationToken

The 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 string

The resource associated with the scopes.

cancellationToken CancellationToken

The 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 TScope

The scope to remove from the cache.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask

A ValueTask that can be used to monitor the asynchronous operation.