Table of Contents

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

dependencies DatabaseDependencies
clusterCache IKEFCoreClusterCache
infrastructureLogger IDiagnosticsLogger<DbLoggerCategory.Infrastructure>
options IDbContextOptions
designTimeModel IDesignTimeModel
updateAdapterFactory IUpdateAdapterFactory
updateLogger IDiagnosticsLogger<DbLoggerCategory.Update>
transactionManager IDbContextTransactionManager

Properties

Cluster

The referring IKEFCoreCluster

public virtual IKEFCoreCluster Cluster { get; }

Property Value

IKEFCoreCluster

DesignTimeModel

Reference to IDesignTimeModel received

public virtual IDesignTimeModel DesignTimeModel { get; }

Property Value

IDesignTimeModel

InfrastructureLogger

public virtual IDiagnosticsLogger<DbLoggerCategory.Infrastructure> InfrastructureLogger { get; }

Property Value

IDiagnosticsLogger<DbLoggerCategory.Infrastructure>

Options

Reference to KEFCoreOptionsExtension received

public virtual KEFCoreOptionsExtension Options { get; }

Property Value

KEFCoreOptionsExtension

Tables

Reference to the set of IKEFCoreTable associated

public virtual IReadOnlyList<IKEFCoreTable> Tables { get; }

Property Value

IReadOnlyList<IKEFCoreTable>

TransactionManager

Reference to IDbContextTransactionManager received

public virtual IDbContextTransactionManager TransactionManager { get; }

Property Value

IDbContextTransactionManager

UpdateAdapterFactory

Reference to IUpdateAdapterFactory received

public virtual IUpdateAdapterFactory UpdateAdapterFactory { get; }

Property Value

IUpdateAdapterFactory

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

bool

EnsureDatabaseCreated()

Execute the EnsureCreated()

public virtual bool EnsureDatabaseCreated()

Returns

bool

EnsureDatabaseDeleted()

Execute the EnsureDeleted()

public virtual bool EnsureDatabaseDeleted()

Returns

bool

EnsureDatabaseSynchronized(long)

Verify if local instance is synchronized with the Cluster

public virtual bool? EnsureDatabaseSynchronized(long timeout)

Parameters

timeout long

Returns

bool?

RegisterTables(IEnumerable<IKEFCoreTable>)

Register IKEFCoreTable in this instance

public virtual void RegisterTables(IEnumerable<IKEFCoreTable> tables)

Parameters

tables IEnumerable<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

entries IList<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

entries IList<IUpdateEntry>

Entries representing the changes to be persisted.

cancellationToken CancellationToken

A 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.