OrionPatch.EntityFrameworkCore
0.2.0
dotnet add package OrionPatch.EntityFrameworkCore --version 0.2.0
NuGet\Install-Package OrionPatch.EntityFrameworkCore -Version 0.2.0
<PackageReference Include="OrionPatch.EntityFrameworkCore" Version="0.2.0" />
<PackageVersion Include="OrionPatch.EntityFrameworkCore" Version="0.2.0" />
<PackageReference Include="OrionPatch.EntityFrameworkCore" />
paket add OrionPatch.EntityFrameworkCore --version 0.2.0
#r "nuget: OrionPatch.EntityFrameworkCore, 0.2.0"
#:package OrionPatch.EntityFrameworkCore@0.2.0
#addin nuget:?package=OrionPatch.EntityFrameworkCore&version=0.2.0
#tool nuget:?package=OrionPatch.EntityFrameworkCore&version=0.2.0
OrionPatch.EntityFrameworkCore
EF Core storage backend for OrionPatch. Adds the OrionPatch_Outbox table with provider-aware competing-consumers claim and a SaveChangesInterceptor that flushes buffered messages into your transaction.
30-second quick start
services.AddDbContext<AppDbContext>((sp, options) =>
{
options.UseNpgsql(connectionString);
options.UseOrionPatch(sp); // hook the interceptor into your DbContext
});
services.AddOrionPatch()
.UseEntityFrameworkCore<AppDbContext>()
.UseSink<MyKafkaSink>();
In your DbContext.OnModelCreating:
protected override void OnModelCreating(ModelBuilder modelBuilder) =>
modelBuilder.ApplyOrionPatchConfiguration();
Enqueue from service code:
_outbox.Enqueue(new OrderConfirmed(orderId, totalCents));
await _db.SaveChangesAsync(ct); // outbox row commits with your other entity changes
What's in the box
OutboxEntityConfiguration— mapsOutboxRowtoOrionPatch_Outboxwith covering indexes for the dispatcher's polling and lease-expiry queries.EfCoreOutbox—IOutboxthat buffers per-DbContext and binds viaConditionalWeakTableso the interceptor finds the right buffer without a service-provider hop.OrionPatchSaveChangesInterceptor— six-override lifecycle (Saving / Saved / SaveChangesFailed and their async siblings) implementing a three-phase Flush / Commit / Revert so save failures re-buffer cleanly without double-inserting on retry.EfCoreOutboxStorage— claim/complete/fail/dead-letter viaExecuteUpdateAsyncsingle round-trips.- Provider-aware claim strategy:
- SqlServer / PostgreSQL / MySQL —
SkipLockedClaimStrategywith dialect-specific SQL. (v0.1.0 currently delegates these to the portable fallback; trueSKIP LOCKEDSQL lands in v0.2.) - SQLite + unknown providers —
CompareAndSwapClaimStrategy(portable optimistic-concurrency claim).
- SqlServer / PostgreSQL / MySQL —
Multi-DbContext
v0.1.0 supports one OrionPatch-bound DbContext per host. Calling UseEntityFrameworkCore<TDbContext> twice silently overrides the previous registration's IOutbox and IOutboxStorage services. First-class multi-DbContext support is on the v0.2 roadmap.
See the repo README for the full picture.
| Product | Versions 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. |
-
net10.0
- Microsoft.EntityFrameworkCore (>= 8.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.10)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- OrionPatch (>= 0.2.0)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.10)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- OrionPatch (>= 0.2.0)
-
net9.0
- Microsoft.EntityFrameworkCore (>= 8.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.10)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
- OrionPatch (>= 0.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.