Table of Contents

Class KEFCoreEntityTypeBuilderRocksDbExtensions

Namespace
MASES.EntityFrameworkCore.KNet.Extensions
Assembly
MASES.EntityFrameworkCore.KNet.dll

Fluent API extensions for configuring KEFCore RocksDB lifecycle behavior on entity types.

public static class KEFCoreEntityTypeBuilderRocksDbExtensions
Inheritance
KEFCoreEntityTypeBuilderRocksDbExtensions
Inherited Members

Remarks

Two configuration models are supported:

Methods

HasKEFCoreRocksDbLifecycle(EntityTypeBuilder, Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>?, Action<Options, IDictionary<string, object>>?)

Associates RocksDB callback handlers to the entity type.

public static EntityTypeBuilder HasKEFCoreRocksDbLifecycle(this EntityTypeBuilder entityTypeBuilder, Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>? onSetConfig, Action<Options, IDictionary<string, object>>? onClose)

Parameters

entityTypeBuilder EntityTypeBuilder

The entity type builder.

onSetConfig Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>

Callback invoked when RocksDB configures the state store. The data dictionary supplied to this callback is the per-store lifetime container that must retain any managed object still referenced by native RocksDB components.

onClose Action<Options, IDictionary<string, object>>

Callback invoked when RocksDB closes the state store. The same per-store lifetime dictionary previously supplied to the onSetConfig callback is passed back so that retained resources can be retrieved and disposed explicitly.

Returns

EntityTypeBuilder

The same builder instance so that multiple calls can be chained.

Exceptions

ArgumentNullException

Thrown when entityTypeBuilder is null.

HasKEFCoreRocksDbLifecycleHandler(EntityTypeBuilder, IRocksDbLifecycleHandler)

Associates a RocksDB lifecycle handler instance to the entity type.

public static EntityTypeBuilder HasKEFCoreRocksDbLifecycleHandler(this EntityTypeBuilder entityTypeBuilder, IRocksDbLifecycleHandler handler)

Parameters

entityTypeBuilder EntityTypeBuilder

The entity type builder.

handler IRocksDbLifecycleHandler

The runtime handler instance implementing IRocksDbLifecycleHandler.

Returns

EntityTypeBuilder

The same builder instance so that multiple calls can be chained.

Exceptions

ArgumentNullException

Thrown when entityTypeBuilder or handler is null.

HasKEFCoreRocksDbLifecycleHandler(EntityTypeBuilder, Type)

Associates a RocksDB lifecycle handler type to the entity type.

public static EntityTypeBuilder HasKEFCoreRocksDbLifecycleHandler(this EntityTypeBuilder entityTypeBuilder, Type handlerType)

Parameters

entityTypeBuilder EntityTypeBuilder

The entity type builder.

handlerType Type

The handler type implementing IRocksDbLifecycleHandler.

Returns

EntityTypeBuilder

The same builder instance so that multiple calls can be chained.

Exceptions

ArgumentNullException

Thrown when entityTypeBuilder or handlerType is null.

ArgumentException

Thrown when handlerType does not implement IRocksDbLifecycleHandler.

HasKEFCoreRocksDbLifecycleHandler<THandler>(EntityTypeBuilder)

Associates a RocksDB lifecycle handler type to the entity type.

public static EntityTypeBuilder HasKEFCoreRocksDbLifecycleHandler<THandler>(this EntityTypeBuilder entityTypeBuilder) where THandler : class, IRocksDbLifecycleHandler

Parameters

entityTypeBuilder EntityTypeBuilder

The entity type builder.

Returns

EntityTypeBuilder

The same builder instance so that multiple calls can be chained.

Type Parameters

THandler

The handler type implementing IRocksDbLifecycleHandler.

HasKEFCoreRocksDbLifecycleHandler<TEntity>(EntityTypeBuilder<TEntity>, IRocksDbLifecycleHandler)

Associates a RocksDB lifecycle handler instance to the entity type.

public static EntityTypeBuilder<TEntity> HasKEFCoreRocksDbLifecycleHandler<TEntity>(this EntityTypeBuilder<TEntity> entityTypeBuilder, IRocksDbLifecycleHandler handler) where TEntity : class

Parameters

entityTypeBuilder EntityTypeBuilder<TEntity>

The strongly typed entity type builder.

handler IRocksDbLifecycleHandler

The runtime handler instance implementing IRocksDbLifecycleHandler.

Returns

EntityTypeBuilder<TEntity>

The same builder instance so that multiple calls can be chained.

Type Parameters

TEntity

The CLR entity type.

HasKEFCoreRocksDbLifecycleHandler<TEntity, THandler>(EntityTypeBuilder<TEntity>)

Associates a RocksDB lifecycle handler type to the entity type.

public static EntityTypeBuilder<TEntity> HasKEFCoreRocksDbLifecycleHandler<TEntity, THandler>(this EntityTypeBuilder<TEntity> entityTypeBuilder) where TEntity : class where THandler : class, IRocksDbLifecycleHandler

Parameters

entityTypeBuilder EntityTypeBuilder<TEntity>

The strongly typed entity type builder.

Returns

EntityTypeBuilder<TEntity>

The same builder instance so that multiple calls can be chained.

Type Parameters

TEntity

The CLR entity type.

THandler

The handler type implementing IRocksDbLifecycleHandler.

HasKEFCoreRocksDbLifecycle<TEntity>(EntityTypeBuilder<TEntity>, Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>?, Action<Options, IDictionary<string, object>>?)

Associates RocksDB callback handlers to the entity type.

public static EntityTypeBuilder<TEntity> HasKEFCoreRocksDbLifecycle<TEntity>(this EntityTypeBuilder<TEntity> entityTypeBuilder, Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>? onSetConfig, Action<Options, IDictionary<string, object>>? onClose) where TEntity : class

Parameters

entityTypeBuilder EntityTypeBuilder<TEntity>

The strongly typed entity type builder.

onSetConfig Action<Options, IKNetConfigurationFromMap, IDictionary<string, object>>

Callback invoked when RocksDB configures the state store. The data dictionary supplied to this callback is the per-store lifetime container that must retain any managed object still referenced by native RocksDB components.

onClose Action<Options, IDictionary<string, object>>

Callback invoked when RocksDB closes the state store. The same per-store lifetime dictionary previously supplied to the onSetConfig callback is passed back so that retained resources can be retrieved and disposed explicitly.

Returns

EntityTypeBuilder<TEntity>

The same builder instance so that multiple calls can be chained.

Type Parameters

TEntity

The CLR entity type.