Skip to content

DatabaseDapperMaticKeyRepository ​

Namespace: MJCZone.DapperMatic.AspNetCore.Repositories

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

Keeps API keys in a database table, one row each (their secrets only as hashes): every instance of the application reads the same ones. The table is created when first used.

Inheritance ​

Implemented Interfaces:

public

Contents ​

Constructors (1) | Methods (9)

Constructors ​

DatabaseDapperMaticKeyRepository ​

Initializes a new instance of the DatabaseDapperMaticKeyRepository class.

csharp
DatabaseDapperMaticKeyRepository(
    string provider,
    string connectionString,
    IDbConnectionFactory connectionFactory,
    string schemaName,
    string tableName)

Parameters ​

  • provider (string) - The database provider.
  • connectionString (string) - The connection string.
  • connectionFactory (IDbConnectionFactory) - The connection factory.
  • schemaName (string) - The schema of the table, or null for the default one.
  • tableName (string) - The table's name.

Methods ​

MethodSummary
GetAsync
ListAsync
SaveAsync
RevokeAsync
TouchAsync
GetType
ToString
Equals
GetHashCode

GetAsync ​

csharp
Task<DapperMaticApiKey?> GetAsync()

Returns ​

Type: Task<DapperMaticApiKey?>

ListAsync ​

csharp
Task&lt;IReadOnlyList&lt;DapperMaticApiKey&gt;&gt; ListAsync()

Returns ​

Type: Task<IReadOnlyList<DapperMaticApiKey>>

SaveAsync ​

csharp
Task SaveAsync()

Returns ​

Type: Task

RevokeAsync ​

csharp
Task&lt;bool&gt; RevokeAsync()

Returns ​

Type: Task&lt;bool&gt;

TouchAsync ​

csharp
Task TouchAsync()

Returns ​

Type: Task

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()