Show / Hide Table of Contents

# Class OpenIddictEntityFrameworkScopeStore<TScope, TContext, TKey>

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

##### Inheritance

System.Object
OpenIddictEntityFrameworkScopeStore<TScope, TContext, TKey>
OpenIddictEntityFrameworkScopeStore<TContext>

###### Namespace: OpenIddict.EntityFramework

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

##### Syntax

    public class OpenIddictEntityFrameworkScopeStore<TScope, TContext, TKey> : IOpenIddictScopeStore<TScope> where TScope : OpenIddictEntityFrameworkScope<TKey> where TContext : DbContext where TKey : IEquatable<TKey>

##### Type Parameters

Name | Description
--- | ---
TScope | The type of the Scope entity.
TContext | The type of the Entity Framework database context.
TKey | The type of the entity primary keys.

### Constructors

#### OpenIddictEntityFrameworkScopeStore(IMemoryCache, TContext, IOptionsMonitor<OpenIddictEntityFrameworkOptions>)

##### Declaration

    public OpenIddictEntityFrameworkScopeStore(IMemoryCache cache, TContext context, IOptionsMonitor<OpenIddictEntityFrameworkOptions> options)

##### Parameters

Type | Name | Description
--- | --- | ---
IMemoryCache | cache |
TContext | context |
IOptionsMonitor<OpenIddictEntityFrameworkOptions> | options |

### Properties

#### Cache

Gets the memory cache associated with the current store.

##### Declaration

    protected IMemoryCache Cache { get; }

##### Property Value

Type | Description
--- | ---
IMemoryCache |

#### Context

Gets the database context associated with the current store.

##### Declaration

    protected TContext Context { get; }

##### Property Value

Type | Description
--- | ---
TContext |

#### Options

Gets the options associated with the current store.

##### Declaration

    protected IOptionsMonitor<OpenIddictEntityFrameworkOptions> Options { get; }

##### Property Value

Type | Description
--- | ---
IOptionsMonitor<OpenIddictEntityFrameworkOptions> |

### Methods

#### ConvertIdentifierFromString(String)

Converts the provided identifier to a strongly typed key object.

##### Declaration

    public virtual TKey ConvertIdentifierFromString(string identifier)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | identifier | The identifier to convert.

##### Returns

Type | Description
--- | ---
TKey | An instance of `TKey` representing the provided identifier.

#### ConvertIdentifierToString(TKey)

Converts the provided identifier to its string representation.

##### Declaration

    public virtual string ConvertIdentifierToString(TKey identifier)

##### Parameters

Type | Name | Description
--- | --- | ---
TKey | identifier | The identifier to convert.

##### Returns

Type | Description
--- | ---
System.String | A System.String representation of the provided identifier.

#### CountAsync(CancellationToken)

##### Declaration

    public virtual ValueTask<long> CountAsync(CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.Int64> |

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

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<IQueryable<TScope>, IQueryable<TResult>> | query |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.Int64> |

##### Type Parameters

Name | Description
--- | ---
TResult |

#### CreateAsync(TScope, CancellationToken)

##### Declaration

    public virtual ValueTask CreateAsync(TScope scope, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### DeleteAsync(TScope, CancellationToken)

##### Declaration

    public virtual ValueTask DeleteAsync(TScope scope, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### FindByIdAsync(String, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | identifier |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<TScope> |

#### FindByNameAsync(String, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<TScope> |

#### FindByNamesAsync(ImmutableArray<String>, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
ImmutableArray<System.String> | names |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TScope> |

#### FindByResourceAsync(String, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | resource |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TScope> |

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

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<IQueryable<TScope>, TState, IQueryable<TResult>> | query |
TState | state |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<TResult> |

##### Type Parameters

Name | Description
--- | ---
TState |
TResult |

#### GetDescriptionAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.String> |

#### GetDescriptionsAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableDictionary<CultureInfo, System.String>> |

#### GetDisplayNameAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.String> |

#### GetDisplayNamesAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableDictionary<CultureInfo, System.String>> |

#### GetIdAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.String> |

#### GetNameAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.String> |

#### GetPropertiesAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableDictionary<System.String, JsonElement>> |

#### GetResourcesAsync(TScope, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableArray<System.String>> |

#### InstantiateAsync(CancellationToken)

##### Declaration

    public virtual ValueTask<TScope> InstantiateAsync(CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<TScope> |

#### ListAsync(Nullable<Int32>, Nullable<Int32>, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.Nullable<System.Int32> | count |
System.Nullable<System.Int32> | offset |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TScope> |

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

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
System.Func<IQueryable<TScope>, TState, IQueryable<TResult>> | query |
TState | state |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TResult> |

##### Type Parameters

Name | Description
--- | ---
TState |
TResult |

#### SetDescriptionAsync(TScope, String, CancellationToken)

##### Declaration

    public virtual ValueTask SetDescriptionAsync(TScope scope, string description, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
System.String | description |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### SetDescriptionsAsync(TScope, ImmutableDictionary<CultureInfo, String>, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
ImmutableDictionary<CultureInfo, System.String> | descriptions |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### SetDisplayNameAsync(TScope, String, CancellationToken)

##### Declaration

    public virtual ValueTask SetDisplayNameAsync(TScope scope, string name, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
System.String | name |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### SetDisplayNamesAsync(TScope, ImmutableDictionary<CultureInfo, String>, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
ImmutableDictionary<CultureInfo, System.String> | names |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### SetNameAsync(TScope, String, CancellationToken)

##### Declaration

    public virtual ValueTask SetNameAsync(TScope scope, string name, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
System.String | name |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### SetPropertiesAsync(TScope, ImmutableDictionary<String, JsonElement>, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
ImmutableDictionary<System.String, JsonElement> | properties |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### SetResourcesAsync(TScope, ImmutableArray<String>, CancellationToken)

##### Declaration

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

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
ImmutableArray<System.String> | resources |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |

#### UpdateAsync(TScope, CancellationToken)

##### Declaration

    public virtual ValueTask UpdateAsync(TScope scope, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TScope | scope |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask |