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>, 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

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

Properties

Cluster

The referring IKEFCoreCluster

public virtual IKEFCoreCluster Cluster { get; }

Property Value

IKEFCoreCluster

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?

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.