Class KEFCoreDatabase
- Namespace
- MASES.EntityFrameworkCore.KNet.Storage.Internal
- Assembly
- MASES.EntityFrameworkCore.KNet.dll
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public class KEFCoreDatabase : Database, IKEFCoreDatabase, IDatabase, IDisposable
- Inheritance
-
KEFCoreDatabase
- Implements
- Inherited Members
Constructors
KEFCoreDatabase(DatabaseDependencies, IKEFCoreClusterCache, IDiagnosticsLogger<Infrastructure>, IValueGeneratorSelector, IDbContextOptions, IDesignTimeModel, IUpdateAdapterFactory, IDiagnosticsLogger<Update>)
Default initializer
public KEFCoreDatabase(DatabaseDependencies dependencies, IKEFCoreClusterCache clusterCache, IDiagnosticsLogger<DbLoggerCategory.Infrastructure> infrastructureLogger, IValueGeneratorSelector valueGeneratorSelector, IDbContextOptions options, IDesignTimeModel designTimeModel, IUpdateAdapterFactory updateAdapterFactory, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger)
Parameters
dependenciesDatabaseDependenciesclusterCacheIKEFCoreClusterCacheinfrastructureLoggerIDiagnosticsLogger<DbLoggerCategory.Infrastructure>valueGeneratorSelectorIValueGeneratorSelectoroptionsIDbContextOptionsdesignTimeModelIDesignTimeModelupdateAdapterFactoryIUpdateAdapterFactoryupdateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>
Properties
Cluster
The referring IKEFCoreCluster
public virtual IKEFCoreCluster Cluster { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EnsureDatabaseConnected()
Execute the CanConnect()
public virtual bool EnsureDatabaseConnected()
Returns
EnsureDatabaseCreated()
Execute the EnsureCreated()
public virtual bool EnsureDatabaseCreated()
Returns
EnsureDatabaseDeleted()
Execute the EnsureDeleted()
public virtual bool EnsureDatabaseDeleted()
Returns
EnsureDatabaseSynchronized(long)
Verify if local instance is synchronized with the Cluster
public virtual bool? EnsureDatabaseSynchronized(long timeout)
Parameters
timeoutlong
Returns
- bool?
SaveChanges(IList<IUpdateEntry>)
Persists changes from the supplied entries to the database.
public override int SaveChanges(IList<IUpdateEntry> entries)
Parameters
entriesIList<IUpdateEntry>Entries representing the changes to be persisted.
Returns
- int
The number of state entries persisted to the database.
SaveChangesAsync(IList<IUpdateEntry>, CancellationToken)
Asynchronously persists changes from the supplied entries to the database.
public override Task<int> SaveChangesAsync(IList<IUpdateEntry> entries, CancellationToken cancellationToken = default)
Parameters
entriesIList<IUpdateEntry>Entries representing the changes to be persisted.
cancellationTokenCancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- Task<int>
A task that represents the asynchronous save operation. The task result contains the number of entries persisted to the database.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.