OpinionatedEventing.EntityFramework 0.9.0

dotnet add package OpinionatedEventing.EntityFramework --version 0.9.0
                    
NuGet\Install-Package OpinionatedEventing.EntityFramework -Version 0.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpinionatedEventing.EntityFramework" Version="0.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpinionatedEventing.EntityFramework" Version="0.9.0" />
                    
Directory.Packages.props
<PackageReference Include="OpinionatedEventing.EntityFramework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpinionatedEventing.EntityFramework --version 0.9.0
                    
#r "nuget: OpinionatedEventing.EntityFramework, 0.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpinionatedEventing.EntityFramework@0.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpinionatedEventing.EntityFramework&version=0.9.0
                    
Install as a Cake Addin
#tool nuget:?package=OpinionatedEventing.EntityFramework&version=0.9.0
                    
Install as a Cake Tool

OpinionatedEventing.EntityFramework

EF Core integration for OpinionatedEventing. Provides:

  • EfOutboxStoreIOutboxStore backed by EF Core; outbox writes participate in SaveChanges transactions automatically.
  • DomainEventInterceptorSaveChangesInterceptor that harvests domain events from AggregateRoot entities and writes them to the outbox atomically.
  • Saga state persistence — EF Core-backed ISagaStateStore for OpinionatedEventing.Sagas.

Installation

dotnet add package OpinionatedEventing.EntityFramework

Registration

builder.Services.AddOpinionatedEventingEntityFramework<AppDbContext>();

Add the outbox and saga tables to your DbContext:

public class AppDbContext : DbContext
{
    public DbSet<OutboxMessage> OutboxMessages => Set<OutboxMessage>();
    public DbSet<SagaState> SagaStates => Set<SagaState>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyOutboxConfiguration(Database.ProviderName);
        modelBuilder.ApplySagaStateConfiguration(Database.ProviderName);
    }
}

Supported databases

Provider Notes
SQL Server Fully supported. DateTimeOffset columns stored natively.
PostgreSQL Fully supported. DateTimeOffset columns stored natively.
SQLite ⚠️ Not for production use. SQLite has no native DateTimeOffset type. When Database.ProviderName contains "Sqlite", the library automatically applies a value converter that stores all DateTimeOffset columns as UTC ticks (long / INTEGER), preserving sort order on the pending-message and saga-timeout indexes. Useful for local development, testing, and demos.

Then add a migration:

dotnet ef migrations add AddOpinionatedEventing
dotnet ef database update

Domain events on aggregates

Extend AggregateRoot and raise domain events without calling IPublisher directly:

public class Order : AggregateRoot
{
    public Order(Guid id)
    {
        Id = id;
        RaiseDomainEvent(new OrderCreated(id));
    }
}

DomainEventInterceptor harvests RaiseDomainEvent calls during SaveChangesAsync and writes them to the outbox in the same transaction.

Repository

github.com/SierraNL/OpinionatedEventing

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 93 5/8/2026