Table of Contents

Class DapperConfigurationStoreWriter

Namespace
Fdyay.IdentityServer.Dapper.Stores
Assembly
Fdyay.IdentityServer.Dapper.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public sealed class DapperConfigurationStoreWriter : IConfigurationStoreWriter
Inheritance
DapperConfigurationStoreWriter
Implements
Inherited Members

Constructors

DapperConfigurationStoreWriter(IDbConnectionFactory)

Creates a writer over the configuration tables.

public DapperConfigurationStoreWriter(IDbConnectionFactory connectionFactory)

Parameters

connectionFactory IDbConnectionFactory

Opens a connection for each write.

Methods

SaveApiResourceAsync(ApiResource, CancellationToken)

Writes an API resource, replacing any stored API resource with the same name.

public Task SaveApiResourceAsync(ApiResource resource, CancellationToken cancellationToken = default)

Parameters

resource ApiResource

The API resource to store. Its name is the key.

cancellationToken CancellationToken

Cancels the write.

Returns

Task

A task that completes once the resource is stored.

Remarks

Deletes the ApiResources row with this Name, if any, then inserts one holding the resource as JSON. The two statements go in one batch but not in an explicit transaction.

Exceptions

ArgumentNullException

resource is null.

ArgumentException

The resource's name is empty.

SaveApiScopeAsync(ApiScope, CancellationToken)

Writes an API scope, replacing any stored API scope with the same name.

public Task SaveApiScopeAsync(ApiScope scope, CancellationToken cancellationToken = default)

Parameters

scope ApiScope

The API scope to store. Its name is the key.

cancellationToken CancellationToken

Cancels the write.

Returns

Task

A task that completes once the scope is stored.

Remarks

Deletes the ApiScopes row with this Name, if any, then inserts one holding the scope as JSON. The two statements go in one batch but not in an explicit transaction.

Exceptions

ArgumentNullException

scope is null.

ArgumentException

The scope's name is empty.

SaveClientAsync(Client, CancellationToken)

Writes a client, replacing any stored client with the same client id.

public Task SaveClientAsync(Client client, CancellationToken cancellationToken = default)

Parameters

client Client

The client to store. Its ClientId is the key.

cancellationToken CancellationToken

Cancels the write.

Returns

Task

A task that completes once the client is stored.

Remarks

Deletes the Clients row with this ClientId, if any, then inserts one holding the client as JSON with its Enabled flag copied to a column. The two statements go in one batch but not in an explicit transaction.

Exceptions

ArgumentNullException

client is null.

ArgumentException

The client's ClientId is null or empty.

SaveIdentityResourceAsync(IdentityResource, CancellationToken)

Writes an identity resource, replacing any stored identity resource with the same name.

public Task SaveIdentityResourceAsync(IdentityResource resource, CancellationToken cancellationToken = default)

Parameters

resource IdentityResource

The identity resource to store. Its name is the key.

cancellationToken CancellationToken

Cancels the write.

Returns

Task

A task that completes once the resource is stored.

Remarks

Deletes the IdentityResources row with this Name, if any, then inserts one holding the resource as JSON. The two statements go in one batch but not in an explicit transaction.

Exceptions

ArgumentNullException

resource is null.

ArgumentException

The resource's name is empty.