Show / Hide Table of Contents

# Class OpenIddictMongoDbTokenStore<TToken>

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

##### Inheritance

System.Object
OpenIddictMongoDbTokenStore<TToken>

###### Namespace: OpenIddict.MongoDb

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

##### Syntax

    public class OpenIddictMongoDbTokenStore<TToken> : IOpenIddictTokenStore<TToken> where TToken : OpenIddictMongoDbToken

##### Type Parameters

Name | Description
--- | ---
TToken | The type of the Token entity.

### Constructors

#### OpenIddictMongoDbTokenStore(IOpenIddictMongoDbContext, IOptionsMonitor<OpenIddictMongoDbOptions>)

##### Declaration

    public OpenIddictMongoDbTokenStore(IOpenIddictMongoDbContext context, IOptionsMonitor<OpenIddictMongoDbOptions> options)

##### Parameters

Type | Name | Description
--- | --- | ---
IOpenIddictMongoDbContext | context |
IOptionsMonitor<OpenIddictMongoDbOptions> | options |

### Properties

#### Context

Gets the database context associated with the current store.

##### Declaration

    protected IOpenIddictMongoDbContext Context { get; }

##### Property Value

Type | Description
--- | ---
IOpenIddictMongoDbContext |

#### Options

Gets the options associated with the current store.

##### Declaration

    protected IOptionsMonitor<OpenIddictMongoDbOptions> Options { get; }

##### Property Value

Type | Description
--- | ---
IOptionsMonitor<OpenIddictMongoDbOptions> |

### Methods

#### 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<TToken>, IQueryable<TResult>>, CancellationToken)

##### Declaration

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

##### Parameters

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

##### Returns

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

##### Type Parameters

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

#### CreateAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask CreateAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### DeleteAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask DeleteAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### FindAsync(String, String, CancellationToken)

##### Declaration

    public virtual IAsyncEnumerable<TToken> FindAsync(string subject, string client, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | subject |
System.String | client |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TToken> |

#### FindAsync(String, String, String, CancellationToken)

##### Declaration

    public virtual IAsyncEnumerable<TToken> FindAsync(string subject, string client, string status, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | subject |
System.String | client |
System.String | status |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TToken> |

#### FindAsync(String, String, String, String, CancellationToken)

##### Declaration

    public virtual IAsyncEnumerable<TToken> FindAsync(string subject, string client, string status, string type, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | subject |
System.String | client |
System.String | status |
System.String | type |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TToken> |

#### FindByApplicationIdAsync(String, CancellationToken)

##### Declaration

    public virtual IAsyncEnumerable<TToken> FindByApplicationIdAsync(string identifier, CancellationToken cancellationToken)

##### Parameters

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

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TToken> |

#### FindByAuthorizationIdAsync(String, CancellationToken)

##### Declaration

    public virtual IAsyncEnumerable<TToken> FindByAuthorizationIdAsync(string identifier, CancellationToken cancellationToken)

##### Parameters

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

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TToken> |

#### FindByIdAsync(String, CancellationToken)

##### Declaration

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

##### Parameters

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

##### Returns

Type | Description
--- | ---
ValueTask<TToken> |

#### FindByReferenceIdAsync(String, CancellationToken)

##### Declaration

    public virtual ValueTask<TToken> FindByReferenceIdAsync(string identifier, CancellationToken cancellationToken)

##### Parameters

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

##### Returns

Type | Description
--- | ---
ValueTask<TToken> |

#### FindBySubjectAsync(String, CancellationToken)

##### Declaration

    public virtual IAsyncEnumerable<TToken> FindBySubjectAsync(string subject, CancellationToken cancellationToken)

##### Parameters

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

##### Returns

Type | Description
--- | ---
IAsyncEnumerable<TToken> |

#### GetApplicationIdAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetApplicationIdAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

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

##### Declaration

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

##### Parameters

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

##### Returns

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

##### Type Parameters

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

#### GetAuthorizationIdAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetAuthorizationIdAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetCreationDateAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<DateTimeOffset?> GetCreationDateAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.Nullable<System.DateTimeOffset>> |

#### GetExpirationDateAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<DateTimeOffset?> GetExpirationDateAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.Nullable<System.DateTimeOffset>> |

#### GetIdAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetIdAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetPayloadAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetPayloadAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetPropertiesAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetPropertiesAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetRedemptionDateAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<DateTimeOffset?> GetRedemptionDateAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

Type | Description
--- | ---
ValueTask<System.Nullable<System.DateTimeOffset>> |

#### GetReferenceIdAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetReferenceIdAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetStatusAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetStatusAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetSubjectAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetSubjectAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### GetTypeAsync(TToken, CancellationToken)

##### Declaration

    public virtual ValueTask<string> GetTypeAsync(TToken token, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
TToken | token |
CancellationToken | cancellationToken |

##### Returns

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

#### InstantiateAsync(CancellationToken)

##### Declaration

    public virtual ValueTask<TToken> InstantiateAsync(CancellationToken cancellationToken)

##### Parameters

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

##### Returns

Type | Description
--- | ---
ValueTask<TToken> |

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

##### Declaration

    public virtual IAsyncEnumerable<TToken> 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<TToken> |

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

##### Declaration

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

##### Parameters

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

##### Returns

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

##### Type Parameters

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

#### PruneAsync(DateTimeOffset, CancellationToken)

##### Declaration

    public virtual ValueTask PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)

##### Parameters

Type | Name | Description
--- | --- | ---
System.DateTimeOffset | threshold |
CancellationToken | cancellationToken |

##### Returns

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