Table of Contents

Interface IOpenIddictScopeStore<TScope>

Namespace
OpenIddict.Abstractions
Assembly
OpenIddict.Abstractions.dll

Provides methods allowing to manage the scopes stored in a database.

public interface IOpenIddictScopeStore<TScope> where TScope : class

Type Parameters

TScope

The type of the Scope entity.

Methods

CountAsync(CancellationToken)

Determines the number of scopes that exist in the database.

ValueTask<long> CountAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<long>

A ValueTask that can be used to monitor the asynchronous operation, whose result returns the number of scopes in the database.

CountAsync<TResult>(Func<IQueryable<TScope>, IQueryable<TResult>>, CancellationToken)

Determines the number of scopes that match the specified query.

ValueTask<long> CountAsync<TResult>(Func<IQueryable<TScope>, IQueryable<TResult>> query, CancellationToken cancellationToken)

Parameters

query Func<IQueryable<TScope>, IQueryable<TResult>>

The query to execute.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<long>

A ValueTask that can be used to monitor the asynchronous operation, whose result returns the number of scopes that match the specified query.

Type Parameters

TResult

The result type.

CreateAsync(TScope, CancellationToken)

Creates a new scope.

ValueTask CreateAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope to create.

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.

DeleteAsync(TScope, CancellationToken)

Removes an existing scope.

ValueTask DeleteAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope to delete.

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 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 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.

GetAsync<TState, TResult>(Func<IQueryable<TScope>, TState, IQueryable<TResult>>, TState, CancellationToken)

Executes the specified query and returns the first element.

ValueTask<TResult?> GetAsync<TState, TResult>(Func<IQueryable<TScope>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken)

Parameters

query Func<IQueryable<TScope>, TState, IQueryable<TResult>>

The query to execute.

state TState

The optional state.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<TResult>

A ValueTask that can be used to monitor the asynchronous operation, whose result returns the first element returned when executing the query.

Type Parameters

TState

The state type.

TResult

The result type.

GetDescriptionAsync(TScope, CancellationToken)

Retrieves the description associated with a scope.

ValueTask<string?> GetDescriptionAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<string>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the description associated with the specified scope.

GetDescriptionsAsync(TScope, CancellationToken)

Retrieves the localized descriptions associated with a scope.

ValueTask<ImmutableDictionary<CultureInfo, string>> GetDescriptionsAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<ImmutableDictionary<CultureInfo, string>>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the localized descriptions associated with the specified scope.

GetDisplayNameAsync(TScope, CancellationToken)

Retrieves the display name associated with a scope.

ValueTask<string?> GetDisplayNameAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<string>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the display name associated with the scope.

GetDisplayNamesAsync(TScope, CancellationToken)

Retrieves the localized display names associated with a scope.

ValueTask<ImmutableDictionary<CultureInfo, string>> GetDisplayNamesAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<ImmutableDictionary<CultureInfo, string>>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the localized display names associated with the scope.

GetIdAsync(TScope, CancellationToken)

Retrieves the unique identifier associated with a scope.

ValueTask<string?> GetIdAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<string>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the unique identifier associated with the scope.

GetNameAsync(TScope, CancellationToken)

Retrieves the name associated with a scope.

ValueTask<string?> GetNameAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<string>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the name associated with the specified scope.

GetPropertiesAsync(TScope, CancellationToken)

Retrieves the additional properties associated with a scope.

ValueTask<ImmutableDictionary<string, JsonElement>> GetPropertiesAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<ImmutableDictionary<string, JsonElement>>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the additional properties associated with the scope.

GetResourcesAsync(TScope, CancellationToken)

Retrieves the resources associated with a scope.

ValueTask<ImmutableArray<string>> GetResourcesAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask<ImmutableArray<string>>

A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the resources associated with the scope.

InstantiateAsync(CancellationToken)

Instantiates a new scope.

ValueTask<TScope> InstantiateAsync(CancellationToken cancellationToken)

Parameters

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 instantiated scope, that can be persisted in the database.

ListAsync(int?, int?, CancellationToken)

Executes the specified query and returns all the corresponding elements.

IAsyncEnumerable<TScope> ListAsync(int? count, int? offset, CancellationToken cancellationToken)

Parameters

count int?

The number of results to return.

offset int?

The number of results to skip.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

IAsyncEnumerable<TScope>

All the elements returned when executing the specified query.

ListAsync<TState, TResult>(Func<IQueryable<TScope>, TState, IQueryable<TResult>>, TState, CancellationToken)

Executes the specified query and returns all the corresponding elements.

IAsyncEnumerable<TResult> ListAsync<TState, TResult>(Func<IQueryable<TScope>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken)

Parameters

query Func<IQueryable<TScope>, TState, IQueryable<TResult>>

The query to execute.

state TState

The optional state.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

IAsyncEnumerable<TResult>

All the elements returned when executing the specified query.

Type Parameters

TState

The state type.

TResult

The result type.

SetDescriptionAsync(TScope, string?, CancellationToken)

Sets the description associated with a scope.

ValueTask SetDescriptionAsync(TScope scope, string? description, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

description string

The description associated with the authorization.

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.

SetDescriptionsAsync(TScope, ImmutableDictionary<CultureInfo, string>, CancellationToken)

Sets the localized descriptions associated with a scope.

ValueTask SetDescriptionsAsync(TScope scope, ImmutableDictionary<CultureInfo, string> descriptions, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

descriptions ImmutableDictionary<CultureInfo, string>

The localized descriptions associated with the authorization.

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.

SetDisplayNameAsync(TScope, string?, CancellationToken)

Sets the display name associated with a scope.

ValueTask SetDisplayNameAsync(TScope scope, string? name, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

name string

The display name associated with the scope.

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.

SetDisplayNamesAsync(TScope, ImmutableDictionary<CultureInfo, string>, CancellationToken)

Sets the localized display names associated with a scope.

ValueTask SetDisplayNamesAsync(TScope scope, ImmutableDictionary<CultureInfo, string> names, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

names ImmutableDictionary<CultureInfo, string>

The localized display names associated with the scope.

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.

SetNameAsync(TScope, string?, CancellationToken)

Sets the name associated with a scope.

ValueTask SetNameAsync(TScope scope, string? name, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

name string

The name associated with the authorization.

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.

SetPropertiesAsync(TScope, ImmutableDictionary<string, JsonElement>, CancellationToken)

Sets the additional properties associated with a scope.

ValueTask SetPropertiesAsync(TScope scope, ImmutableDictionary<string, JsonElement> properties, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

properties ImmutableDictionary<string, JsonElement>

The additional properties associated with the scope.

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.

SetResourcesAsync(TScope, ImmutableArray<string>, CancellationToken)

Sets the resources associated with a scope.

ValueTask SetResourcesAsync(TScope scope, ImmutableArray<string> resources, CancellationToken cancellationToken)

Parameters

scope TScope

The scope.

resources ImmutableArray<string>

The resources associated with the scope.

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.

UpdateAsync(TScope, CancellationToken)

Updates an existing scope.

ValueTask UpdateAsync(TScope scope, CancellationToken cancellationToken)

Parameters

scope TScope

The scope to update.

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.