Cephalon.EventSourcing.EntityFramework
Maturity:
M1· Ownership: provider-managed · Family:event-sourcing· See audit, matrix.
Cephalon.EventSourcing.EntityFramework is the first provider-backed event-store baseline for Cephalon event-sourcing workloads.
What it owns
Section titled “What it owns”- an Entity Framework Core event-store provider registered through
AddCephalonEntityFrameworkEventSourcing<TContext>() - the
EntityFrameworkEventEntrypersistence model for append-only event rows - model configuration for the
CephalonEventstable and its indexes - optimistic-version append semantics on top of
IEventStore - stream replay reads ordered by
StreamVersion - a truthful event-stream contribution that identifies the active provider as
entity-framework
Main surfaces
Section titled “Main surfaces”EntityFrameworkEventEntry.csEntityFrameworkEventSourcingConfiguration.csIEntityFrameworkEventContext.csHosting/EntityFrameworkEventSourcingServiceCollectionExtensions.csRegistration/EntityFrameworkEventSourcingEngineBuilderExtensions.csServices/EntityFrameworkEventStore.cs
Provider usage
Section titled “Provider usage”builder.Services.AddDbContext<OrdersDbContext>(options => options.UseSqlite(connectionString));
builder.Services.AddCephalonEventSourcing(options =>{ options.DefaultProvider = "entity-framework";});
builder.Services.AddCephalonEntityFrameworkEventSourcing<OrdersDbContext>();OrdersDbContext must implement IEntityFrameworkEventContext:
public sealed class OrdersDbContext(DbContextOptions<OrdersDbContext> options) : DbContext(options), IEntityFrameworkEventContext{ public DbSet<EntityFrameworkEventEntry> Events => Set<EntityFrameworkEventEntry>();
protected override void OnModelCreating(ModelBuilder modelBuilder) { EntityFrameworkEventSourcingConfiguration.ConfigureCephalonEvents(modelBuilder); }}Concurrency semantics
Section titled “Concurrency semantics”GetVersionAsync(streamId)returns-1when the stream does not exist yetAppendAsync(..., expectedVersion: -1)requires a new stream with no persisted eventsAppendAsyncthrowsEventStreamConcurrencyExceptionwhen the persisted version does not matchexpectedVersion- appended events must already carry the exact sequential versions being persisted
- the provider stores the CLR event type as
AssemblyQualifiedNameand serializes payloads throughSystem.Text.Json
Not shipped in this slice
Section titled “Not shipped in this slice”This provider intentionally does not claim:
- snapshot persistence
- projection rebuild orchestration
- archival or retention management
- background replay workers
- transport/event-bus integration
It is a narrow append/read provider for the baseline IEventStore contract.