Table of Contents

Class KEFCoreDbContextOptionsExtensions

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

KEFCore specific extension methods for DbContextOptionsBuilder.

public static class KEFCoreDbContextOptionsExtensions
Inheritance
KEFCoreDbContextOptionsExtensions
Inherited Members

Methods

JVMKeyType(IKEFCoreSingletonOptions, IEntityType)

Create the ValueContainer Type

public static Type JVMKeyType(this IKEFCoreSingletonOptions options, IEntityType entityType)

Parameters

options IKEFCoreSingletonOptions
entityType IEntityType

Returns

Type

JVMValueContainerType(IKEFCoreSingletonOptions, IEntityType)

Create the ValueContainer Type

public static Type JVMValueContainerType(this IKEFCoreSingletonOptions options, IEntityType entityType)

Parameters

options IKEFCoreSingletonOptions
entityType IEntityType

Returns

Type

KeyType(IKEFCoreSingletonOptions, IEntityType)

Creates a serializer Type for keys

public static Type KeyType(this IKEFCoreSingletonOptions options, IEntityType entityType)

Parameters

options IKEFCoreSingletonOptions
entityType IEntityType

Returns

Type

SerDesSelectorForKey(IKEFCoreSingletonOptions, IEntityType)

Creates a serializer Type for keys

public static ISerDesSelector? SerDesSelectorForKey(this IKEFCoreSingletonOptions options, IEntityType entityType)

Parameters

options IKEFCoreSingletonOptions
entityType IEntityType

Returns

ISerDesSelector

SerDesSelectorForValue(IKEFCoreSingletonOptions, IEntityType)

Creates a serialzier Type for values

public static ISerDesSelector? SerDesSelectorForValue(this IKEFCoreSingletonOptions options, IEntityType entityType)

Parameters

options IKEFCoreSingletonOptions
entityType IEntityType

Returns

ISerDesSelector

UseKEFCore(DbContextOptionsBuilder, string?, string, Action<KEFCoreDbContextOptionsBuilder>?)

Configures the context to connect to a named Apache Kafka cluster. The Apache Kafka cluster is shared anywhere the same name is used, but only for a given service provider.

public static DbContextOptionsBuilder UseKEFCore(this DbContextOptionsBuilder optionsBuilder, string? applicationId, string bootstrapServers, Action<KEFCoreDbContextOptionsBuilder>? kefcoreOptionsAction = null)

Parameters

optionsBuilder DbContextOptionsBuilder

The builder being used to configure the context.

applicationId string

The name of the application will use bootstrapServers. This allows the scope of the Apache Kafka cluster to be controlled independently of the context. The Apache Kafka cluster is shared anywhere the same name is used.

bootstrapServers string

The bootstrap servers of the Kafka cluster.

kefcoreOptionsAction Action<KEFCoreDbContextOptionsBuilder>

An optional action to allow additional Kafka specific configuration.

Returns

DbContextOptionsBuilder

The options builder so that further configuration can be chained.

Remarks

See Using DbContextOptions, and The EF Core Apache Kafka cluster provider for more information and examples.

UseKEFCore<TContext>(DbContextOptionsBuilder<TContext>, string, string, Action<KEFCoreDbContextOptionsBuilder>?)

Configures the context to connect to an Apache Kafka cluster. The Apache Kafka cluster is shared anywhere the same name is used, but only for a given service provider.

public static DbContextOptionsBuilder<TContext> UseKEFCore<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder, string applicationId, string bootstrapServers, Action<KEFCoreDbContextOptionsBuilder>? kefcoreOptionsAction = null) where TContext : DbContext

Parameters

optionsBuilder DbContextOptionsBuilder<TContext>

The builder being used to configure the context.

applicationId string

The name of the application will use bootstrapServers. This allows the scope of the Apache Kafka cluster to be controlled independently of the context. The Apache Kafka cluster is shared anywhere the same name is used.

bootstrapServers string

The bootstrap servers of the Kafka cluster.

kefcoreOptionsAction Action<KEFCoreDbContextOptionsBuilder>

An optional action to allow additional Apache Kafka cluster specific configuration.

Returns

DbContextOptionsBuilder<TContext>

The options builder so that further configuration can be chained.

Type Parameters

TContext

The type of context being configured.

Remarks

See Using DbContextOptions, and The EF Core Apache Kafka cluster provider for more information and examples.

ValueContainerType(IKEFCoreSingletonOptions, IEntityType)

Create the ValueContainer Type

public static Type ValueContainerType(this IKEFCoreSingletonOptions options, IEntityType entityType)

Parameters

options IKEFCoreSingletonOptions
entityType IEntityType

Returns

Type