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:
- A handler type implementing IRocksDbLifecycleHandler.
-
Two callback handlers, one for
OnSetConfigand one forOnClose, internally wrapped into an IRocksDbLifecycleHandler.
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
entityTypeBuilderEntityTypeBuilderThe entity type builder.
onSetConfigAction<Options, IKNetConfigurationFromMap, IDictionary<string, object>>Callback invoked when RocksDB configures the state store. The
datadictionary supplied to this callback is the per-store lifetime container that must retain any managed object still referenced by native RocksDB components.onCloseAction<Options, IDictionary<string, object>>Callback invoked when RocksDB closes the state store. The same per-store lifetime dictionary previously supplied to the
onSetConfigcallback 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
entityTypeBuilderis null.
HasKEFCoreRocksDbLifecycleHandler(EntityTypeBuilder, IRocksDbLifecycleHandler)
Associates a RocksDB lifecycle handler instance to the entity type.
public static EntityTypeBuilder HasKEFCoreRocksDbLifecycleHandler(this EntityTypeBuilder entityTypeBuilder, IRocksDbLifecycleHandler handler)
Parameters
entityTypeBuilderEntityTypeBuilderThe entity type builder.
handlerIRocksDbLifecycleHandlerThe runtime handler instance implementing IRocksDbLifecycleHandler.
Returns
- EntityTypeBuilder
The same builder instance so that multiple calls can be chained.
Exceptions
- ArgumentNullException
Thrown when
entityTypeBuilderorhandleris null.
HasKEFCoreRocksDbLifecycleHandler(EntityTypeBuilder, Type)
Associates a RocksDB lifecycle handler type to the entity type.
public static EntityTypeBuilder HasKEFCoreRocksDbLifecycleHandler(this EntityTypeBuilder entityTypeBuilder, Type handlerType)
Parameters
entityTypeBuilderEntityTypeBuilderThe entity type builder.
handlerTypeTypeThe handler type implementing IRocksDbLifecycleHandler.
Returns
- EntityTypeBuilder
The same builder instance so that multiple calls can be chained.
Exceptions
- ArgumentNullException
Thrown when
entityTypeBuilderorhandlerTypeis null.- ArgumentException
Thrown when
handlerTypedoes 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
entityTypeBuilderEntityTypeBuilderThe entity type builder.
Returns
- EntityTypeBuilder
The same builder instance so that multiple calls can be chained.
Type Parameters
THandlerThe 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
entityTypeBuilderEntityTypeBuilder<TEntity>The strongly typed entity type builder.
handlerIRocksDbLifecycleHandlerThe runtime handler instance implementing IRocksDbLifecycleHandler.
Returns
- EntityTypeBuilder<TEntity>
The same builder instance so that multiple calls can be chained.
Type Parameters
TEntityThe 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
entityTypeBuilderEntityTypeBuilder<TEntity>The strongly typed entity type builder.
Returns
- EntityTypeBuilder<TEntity>
The same builder instance so that multiple calls can be chained.
Type Parameters
TEntityThe CLR entity type.
THandlerThe 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
entityTypeBuilderEntityTypeBuilder<TEntity>The strongly typed entity type builder.
onSetConfigAction<Options, IKNetConfigurationFromMap, IDictionary<string, object>>Callback invoked when RocksDB configures the state store. The
datadictionary supplied to this callback is the per-store lifetime container that must retain any managed object still referenced by native RocksDB components.onCloseAction<Options, IDictionary<string, object>>Callback invoked when RocksDB closes the state store. The same per-store lifetime dictionary previously supplied to the
onSetConfigcallback 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
TEntityThe CLR entity type.