Table of Contents

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:

  1. KEFCoreIgnoreEventsAttribute applied to the entity class — always disables events.
  2. HasKEFCoreManageEvents(false) applied to the entity via ModelBuilder, read from the ManageEvents entity annotation.
  3. Context-level default set via UseKEFCoreManageEvents(ModelBuilder, bool), read from the ManageEvents model annotation at model finalization time.
  4. 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

modelBuilder IConventionModelBuilder

The builder for the model.

context IConventionContext<IConventionModelBuilder>

Additional information associated with convention execution.