Class KEFCoreManageEventsConvention
- Namespace
- MASES.EntityFrameworkCore.KNet.Metadata.Conventions
- Assembly
- MASES.EntityFrameworkCore.KNet.dll
A convention that resolves and stores the Kafka event management flag for each entity type as a model annotation (ManageEvents).
public class KEFCoreManageEventsConvention : IModelFinalizingConvention, IConvention
- Inheritance
-
KEFCoreManageEventsConvention
- Implements
- Inherited Members
Remarks
When enabled for an entity, the TimestampExtractor is activated in
StreamsManager.AddEntity(), allowing real-time tracking updates from the cluster.
Event management is enabled by default for all entity types.
Resolution priority:
- KEFCoreIgnoreEventsAttribute applied to the entity class — always disables events.
HasKEFCoreManageEvents(false)applied to the entity viaModelBuilder, read from the ManageEvents entity annotation.- Context-level default set via UseKEFCoreManageEvents(ModelBuilder, bool), read from the ManageEvents model annotation at model finalization time.
- true (default — events managed).
Methods
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)
Called when a model is being finalized.
public void ProcessModelFinalizing(IConventionModelBuilder modelBuilder, IConventionContext<IConventionModelBuilder> context)
Parameters
modelBuilderIConventionModelBuilderThe builder for the model.
contextIConventionContext<IConventionModelBuilder>Additional information associated with convention execution.