Menu

1 / 2

KEFCore: Apache Kafka provider for Entity Framework Core

DEV Community: dotnet·Mario Mastrodicasa·10 days ago
#QiELDaG0
#devtodotnet#devto#dev#kafka#apache
Long article (1985 words) — no AI summary yet.
Reading 0:00
15s threshold

In this article I don’t speak about usage of Entity Framework Core , there are tons of documentation about its usage, but I speak about back-ends. EFCore (Entity Framework Core) relies on providers to communicate with back-ends, the full list is available here .

The question is:

Can EFCore use Apache Kafka as back-end?

The short answer is yes and long answer is KEFCore: Entity Framework Core provider for Apache Kafka .

KEFCore is a provider able to use Apache Kafka as back-end for Entity Framework Core.

Model definition

The model used in the example is the same available here , the difference is in the provider requested: in the example of the repository it is used an Apache Kafka cluster inheriting from KafkaDbContext :

public class BloggingContext : KafkaDbContext { public DbSet < Blog > Blogs { get ; set ; } public DbSet < Post > Posts { get ; set ; } } public class Blog { public int BlogId { get ; set ; } public string Url { get ; set ; } public long Rating { get ; set ; } public List < Post >…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.