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
connectionFactoryIDbConnectionFactoryOpens 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
resourceApiResourceThe API resource to store. Its name is the key.
cancellationTokenCancellationTokenCancels 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
resourceis 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
scopeApiScopeThe API scope to store. Its name is the key.
cancellationTokenCancellationTokenCancels 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
scopeis 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
clientClientThe client to store. Its ClientId is the key.
cancellationTokenCancellationTokenCancels 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
clientis 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
resourceIdentityResourceThe identity resource to store. Its name is the key.
cancellationTokenCancellationTokenCancels 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
resourceis null.- ArgumentException
The resource's name is empty.