What problem does it solve?
This Skill helps .NET developers configure EF Core as an append-only event store using a table-per-hierarchy discriminator, JSON-serialized event payloads, and an outbox message linkage to ensure consistent event sourcing, prevent duplicate events, and integrate reliable message delivery.
Core Features & Use Cases
- TPH Event Store: Maintain a single Events DbSet and use a discriminator column mapped from an EventType enum to concrete event classes.
- Generic JSON Data Conversion: Register GenericEventConfiguration<TEntity,TData> to serialize and deserialize the Data column using Newtonsoft.Json with StringEnumConverter and NullValueHandling.Ignore.
- Outbox Integration & Safety: Configure OutboxMessage as a shared primary key/foreign key to Event.Id and enforce a unique composite index on (AggregateId, Sequence) to prevent duplicates.
- Use Case: Add a new domain event type, update EventConfiguration with HasValue<NewEvent>(EventType.NewEvent), add a GenericEventConfiguration registration, and run EF Core migrations to persist the new event reliably.
Quick Start
Register EventConfiguration and GenericEventConfiguration for each concrete event type in ApplicationDbContext.OnModelCreating and run EF Core migrations.