Table of Contents

Class KEFCoreEntityTypeExtensions

Namespace
MASES.EntityFrameworkCore.KNet.Extensions
Assembly
MASES.EntityFrameworkCore.KNet.dll

Extension methods for IReadOnlyEntityType for the Kafka provider.

public static class KEFCoreEntityTypeExtensions
Inheritance
KEFCoreEntityTypeExtensions
Inherited Members

Remarks

Methods

ApplicationIdForTable(IEntityType, KEFCoreOptionsExtension)

Creates the application id

public static string ApplicationIdForTable(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

string

BuildProducerConfig(IEntityType, KEFCoreOptionsExtension)

Builds the ProducerConfigBuilder for this entity type, merging the global ProducerConfig with any per-entity overrides stored as a KEFCoreProducerAnnotation annotation. Per-entity values take precedence over the global config.

public static ProducerConfigBuilder BuildProducerConfig(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

ProducerConfigBuilder

BuildTopicConfig(IEntityType, KEFCoreOptionsExtension)

Builds the TopicConfigBuilder for this entity type, merging the global TopicConfig with any per-entity retention overrides set via KEFCoreTopicRetentionAttribute or HasKEFCoreTopicRetention(EntityTypeBuilder, long, long). Per-entity values take precedence over the global config.

public static TopicConfigBuilder BuildTopicConfig(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

TopicConfigBuilder

A TopicConfigBuilder ready to pass to CreateTopic(string, int, short, Map<String, String>, IDiagnosticsLogger<Infrastructure>) via ToMap().

ConsumerInstances(IEntityType, KEFCoreOptionsExtension)

Gets consumer instances

[Obsolete("Option will be removed soon")]
public static int? ConsumerInstances(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

int?

GetKEFCoreTopicName(IEntityType)

Creates the topic name

public static string GetKEFCoreTopicName(this IEntityType entityType)

Parameters

entityType IEntityType

Returns

string

GetKeySerDesSelectorType(IEntityType, IKEFCoreSingletonOptions)

Returns the key serializer selector type for this entity type. Reads KeySerDesSelectorType annotation first, falling back to KeySerDesSelectorType.

public static Type? GetKeySerDesSelectorType(this IEntityType entityType, IKEFCoreSingletonOptions options)

Parameters

entityType IEntityType
options IKEFCoreSingletonOptions

Returns

Type

GetManageEvents(IEntityType)

Returns whether KEFCore event management is enabled for this entity type. Reads the ManageEvents annotation set by KEFCoreManageEventsConvention.

public static bool GetManageEvents(this IEntityType entityType)

Parameters

entityType IEntityType

The IEntityType to query.

Returns

bool

true if event management is enabled (default); false if disabled via KEFCoreIgnoreEventsAttribute or HasKEFCoreManageEvents(false).

GetReadOnly(IEntityType, KEFCoreOptionsExtension)

Returns whether this entity type is read-only. Returns true if KEFCoreReadOnlyAttribute is applied or if the context-level ReadOnlyMode is enabled.

public static bool GetReadOnly(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

bool

GetTopicRetentionBytes(IEntityType)

Returns the per-entity topic retention in bytes, or null if not set. When null, the global TopicConfig applies.

public static long? GetTopicRetentionBytes(this IEntityType entityType)

Parameters

entityType IEntityType

Returns

long?

GetTopicRetentionMs(IEntityType)

Returns the per-entity topic retention in milliseconds, or null if not set. When null, the global TopicConfig applies.

public static long? GetTopicRetentionMs(this IEntityType entityType)

Parameters

entityType IEntityType

Returns

long?

GetTransactionGroup(IEntityType)

Returns the Kafka transaction group for this entity type, or null if the entity does not participate in a Kafka transaction.

public static string? GetTransactionGroup(this IEntityType entityType)

Parameters

entityType IEntityType

Returns

string

GetUseStoreKeyRange(IEntityType, KEFCoreOptionsExtension)

Returns whether key range look-up optimization is enabled for this entity type. Reads UseStoreKeyRange annotation first, falling back to UseStoreKeyRange.

public static bool GetUseStoreKeyRange(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

bool

GetUseStorePrefixScan(IEntityType, KEFCoreOptionsExtension)

Returns whether prefix scan optimization is enabled for this entity type. Reads UseStorePrefixScan annotation first, falling back to UseStorePrefixScan.

public static bool GetUseStorePrefixScan(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

bool

GetUseStoreReverse(IEntityType, KEFCoreOptionsExtension)

Returns whether reverse iteration optimization is enabled for this entity type. Reads UseStoreReverse annotation first, falling back to UseStoreReverse.

public static bool GetUseStoreReverse(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

bool

GetUseStoreReverseKeyRange(IEntityType, KEFCoreOptionsExtension)

Returns whether reverse key range look-up optimization is enabled for this entity type. Reads UseStoreReverseKeyRange annotation first, falling back to UseStoreReverseKeyRange.

public static bool GetUseStoreReverseKeyRange(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

bool

GetUseStoreSingleKeyLookup(IEntityType, KEFCoreOptionsExtension)

Returns whether single key look-up optimization is enabled for this entity type. Reads UseStoreSingleKeyLookup annotation first, falling back to UseStoreSingleKeyLookup.

public static bool GetUseStoreSingleKeyLookup(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

bool

GetValueContainerType(IEntityType, IKEFCoreSingletonOptions)

Returns the value container type for this entity type. Reads ValueContainerType annotation first, falling back to ValueContainerType.

public static Type? GetValueContainerType(this IEntityType entityType, IKEFCoreSingletonOptions options)

Parameters

entityType IEntityType
options IKEFCoreSingletonOptions

Returns

Type

GetValueSerDesSelectorType(IEntityType, IKEFCoreSingletonOptions)

Returns the value container serializer selector type for this entity type. Reads ValueSerDesSelectorType annotation first, falling back to ValueSerDesSelectorType.

public static Type? GetValueSerDesSelectorType(this IEntityType entityType, IKEFCoreSingletonOptions options)

Parameters

entityType IEntityType
options IKEFCoreSingletonOptions

Returns

Type

NumPartitions(IEntityType, KEFCoreOptionsExtension)

Returns the number of partitions for the Kafka topic associated with this entity type. Reads NumPartitions annotation first, falling back to DefaultNumPartitions.

public static int NumPartitions(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

int

ReplicationFactor(IEntityType, KEFCoreOptionsExtension)

Returns the replication factor for the Kafka topic associated with this entity type. Reads ReplicationFactor annotation first, falling back to DefaultReplicationFactor.

public static short ReplicationFactor(this IEntityType entityType, KEFCoreOptionsExtension options)

Parameters

entityType IEntityType
options KEFCoreOptionsExtension

Returns

short

StorageIdForTable(IEntityType)

Creates the storage id

public static string StorageIdForTable(this IEntityType entityType)

Parameters

entityType IEntityType

Returns

string