Show / Hide Table of Contents

# Interface IOpenIddictScopeCache<TScope>

Provides methods allowing to cache scopes after retrieving them from the store.

###### Namespace: OpenIddict.Abstractions

###### Assembly: cs.temp.dll.dll

##### Syntax

    public interface IOpenIddictScopeCache<TScope>
        where TScope : class

##### Type Parameters

Name | Description
--- | ---
TScope | The type of the Scope entity.

### Methods

#### AddAsync(TScope, CancellationToken)

Add the specified scope to the cache.

##### Declaration

    ValueTask AddAsync(TScope scope, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope | The scope to add to the cache.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### FindByIdAsync(String, CancellationToken)

Retrieves a scope using its unique identifier.

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | identifier | The unique identifier associated with the scope.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<TScope> | A 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.

##### Declaration

    ValueTask<TScope> FindByNameAsync(string name, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The name associated with the scope.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<TScope> | A 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.

##### Declaration

    IAsyncEnumerable<TScope> FindByNamesAsync(ImmutableArray<string> names, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
ImmutableArray<System.String> | names | The names associated with the scopes.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TScope> | The scopes corresponding to the specified names.

#### FindByResourceAsync(String, CancellationToken)

Retrieves all the scopes that contain the specified resource.

##### Declaration

    IAsyncEnumerable<TScope> FindByResourceAsync(string resource, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | resource | The resource associated with the scopes.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TScope> | The scopes associated with the specified resource.

#### RemoveAsync(TScope, CancellationToken)

Removes the specified scope from the cache.

##### Declaration

    ValueTask RemoveAsync(TScope scope, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope | The scope to remove from the cache.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.