Class KafkaDbContextOptionsExtensions
- Namespace
- MASES.EntityFrameworkCore.KNet
- Assembly
- MASES.EntityFrameworkCore.KNet.dll
Kafka specific extension methods for DbContextOptionsBuilder.
public static class KafkaDbContextOptionsExtensions
- Inheritance
-
KafkaDbContextOptionsExtensions
- Inherited Members
Methods
JVMKeyType(IKafkaSingletonOptions, IEntityType)
Create the ValueContainer Type
public static Type JVMKeyType(this IKafkaSingletonOptions options, IEntityType entityType)
Parameters
options
IKafkaSingletonOptionsentityType
IEntityType
Returns
JVMValueContainerType(IKafkaSingletonOptions, IEntityType)
Create the ValueContainer Type
public static Type JVMValueContainerType(this IKafkaSingletonOptions options, IEntityType entityType)
Parameters
options
IKafkaSingletonOptionsentityType
IEntityType
Returns
KeyType(IKafkaSingletonOptions, IEntityType)
Creates a serializer Type for keys
public static Type KeyType(this IKafkaSingletonOptions options, IEntityType entityType)
Parameters
options
IKafkaSingletonOptionsentityType
IEntityType
Returns
SerDesSelectorForKey(IKafkaSingletonOptions, IEntityType)
Creates a serializer Type for keys
public static ISerDesSelector? SerDesSelectorForKey(this IKafkaSingletonOptions options, IEntityType entityType)
Parameters
options
IKafkaSingletonOptionsentityType
IEntityType
Returns
SerDesSelectorForValue(IKafkaSingletonOptions, IEntityType)
Creates a serialzier Type for values
public static ISerDesSelector? SerDesSelectorForValue(this IKafkaSingletonOptions options, IEntityType entityType)
Parameters
options
IKafkaSingletonOptionsentityType
IEntityType
Returns
UseKafkaCluster(DbContextOptionsBuilder, string, string, string, Action<KafkaDbContextOptionsBuilder>?)
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 UseKafkaCluster(this DbContextOptionsBuilder optionsBuilder, string applicationId, string databaseName, string bootstrapServers, Action<KafkaDbContextOptionsBuilder>? kafkaOptionsAction = null)
Parameters
optionsBuilder
DbContextOptionsBuilderThe builder being used to configure the context.
applicationId
stringThe name of the application will use
databaseName
. 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.databaseName
stringThe name of the Apache Kafka cluster. 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
stringThe bootstrap servers of the Kafka cluster.
kafkaOptionsAction
Action<KafkaDbContextOptionsBuilder>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.
UseKafkaCluster<TContext>(DbContextOptionsBuilder<TContext>, string, string, string, Action<KafkaDbContextOptionsBuilder>?)
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> UseKafkaCluster<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder, string applicationId, string databaseName, string bootstrapServers, Action<KafkaDbContextOptionsBuilder>? kafkaOptionsAction = null) where TContext : DbContext
Parameters
optionsBuilder
DbContextOptionsBuilder<TContext>The builder being used to configure the context.
applicationId
stringThe name of the application will use
databaseName
. 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.databaseName
stringThe name of the Apache Kafka cluster. 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
stringThe bootstrap servers of the Kafka cluster.
kafkaOptionsAction
Action<KafkaDbContextOptionsBuilder>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(IKafkaSingletonOptions, IEntityType)
Create the ValueContainer Type
public static Type ValueContainerType(this IKafkaSingletonOptions options, IEntityType entityType)
Parameters
options
IKafkaSingletonOptionsentityType
IEntityType