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:
- KEFCoreTopicAttribute applied directly to the entity class.
- TableAttribute applied to the entity class,
including schema prefix if specified (e.g.
schema.tablename). - The EF Core entity type name (Name), which includes the model namespace.
The topic prefix is resolved using the following priority order:
- KEFCoreTopicPrefixAttribute applied directly to the entity class (a null prefix explicitly disables prefixing for that entity).
- 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
modelBuilderIConventionModelBuilderThe builder for the model.
contextIConventionContext<IConventionModelBuilder>Additional information associated with convention execution.