Table of Contents

Class KEFCoreTopicNamingConvention

Namespace
MASES.EntityFrameworkCore.KNet.Metadata.Conventions
Assembly
MASES.EntityFrameworkCore.KNet.dll

A convention that resolves and stores the Kafka topic name for each entity type as a model annotation (TopicName).

public class KEFCoreTopicNamingConvention : IModelFinalizingConvention, IConvention
Inheritance
KEFCoreTopicNamingConvention
Implements
Inherited Members

Remarks

The topic name is resolved using the following priority order:

  1. KEFCoreTopicAttribute applied directly to the entity class.
  2. TableAttribute applied to the entity class, including schema prefix if specified (e.g. schema.tablename).
  3. The EF Core entity type name (Name), which includes the model namespace.

The topic prefix is resolved using the following priority order:

  1. KEFCoreTopicPrefixAttribute applied directly to the entity class (a null prefix explicitly disables prefixing for that entity).
  2. The context-level prefix set via UseKEFCoreTopicPrefix(ModelBuilder, string?), read from the TopicPrefix model annotation at model finalization time.

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.