Class StorageInitializer
- Namespace
- Fdyay.IdentityServer.Dapper
- 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 StorageInitializer : IStorageInitializer
- Inheritance
-
StorageInitializer
- Implements
- Inherited Members
Constructors
StorageInitializer(IDbConnectionFactory, DapperStores)
Creates an initializer for the tables of stores.
public StorageInitializer(IDbConnectionFactory connectionFactory, DapperStores stores = DapperStores.All)
Parameters
connectionFactoryIDbConnectionFactoryOpens the connection and supplies the dialect whose schema script is run.
storesDapperStoresThe stores whose tables are created. Defaults to All.
Methods
InitializeAsync(CancellationToken)
Creates whatever tables and indexes the selected stores need and do not yet have.
public Task InitializeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels opening the connection.
Returns
- Task
A task that completes once the schema script has run.
Remarks
Runs the dialect's CreateSchemaScript(DapperStores) in one batch. When the script is empty — no store selected — no connection is opened at all.