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>, IDbContextOptions, IDesignTimeModel, IUpdateAdapterFactory, IDiagnosticsLogger<Update>, IDbContextTransactionManager)
Default initializer
public KEFCoreDatabase(DatabaseDependencies dependencies, IKEFCoreClusterCache clusterCache, IDiagnosticsLogger<DbLoggerCategory.Infrastructure> infrastructureLogger, IDbContextOptions options, IDesignTimeModel designTimeModel, IUpdateAdapterFactory updateAdapterFactory, IDiagnosticsLogger<DbLoggerCategory.Update> updateLogger, IDbContextTransactionManager transactionManager)
Parameters
dependenciesDatabaseDependenciesclusterCacheIKEFCoreClusterCacheinfrastructureLoggerIDiagnosticsLogger<DbLoggerCategory.Infrastructure>optionsIDbContextOptionsdesignTimeModelIDesignTimeModelupdateAdapterFactoryIUpdateAdapterFactoryupdateLoggerIDiagnosticsLogger<DbLoggerCategory.Update>transactionManagerIDbContextTransactionManager
Properties
Cluster
The referring IKEFCoreCluster
public virtual IKEFCoreCluster Cluster { get; }
Property Value
DesignTimeModel
Reference to IDesignTimeModel received
public virtual IDesignTimeModel DesignTimeModel { get; }
Property Value
InfrastructureLogger
Reference to IDiagnosticsLogger<TLoggerCategory> received
public virtual IDiagnosticsLogger<DbLoggerCategory.Infrastructure> InfrastructureLogger { get; }
Property Value
Options
Reference to KEFCoreOptionsExtension received
public virtual KEFCoreOptionsExtension Options { get; }
Property Value
Tables
Reference to the set of IKEFCoreTable associated
public virtual IReadOnlyList<IKEFCoreTable> Tables { get; }
Property Value
TransactionManager
Reference to IDbContextTransactionManager received
public virtual IDbContextTransactionManager TransactionManager { get; }
Property Value
UpdateAdapterFactory
Reference to IUpdateAdapterFactory received
public virtual IUpdateAdapterFactory UpdateAdapterFactory { 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?
RegisterTables(IEnumerable<IKEFCoreTable>)
Register IKEFCoreTable in this instance
public virtual void RegisterTables(IEnumerable<IKEFCoreTable> tables)
Parameters
tablesIEnumerable<IKEFCoreTable>The set of IKEFCoreTable to register
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.