DKNet.EfCore.Events
10.1.10
dotnet add package DKNet.EfCore.Events --version 10.1.10
NuGet\Install-Package DKNet.EfCore.Events -Version 10.1.10
<PackageReference Include="DKNet.EfCore.Events" Version="10.1.10" />
<PackageVersion Include="DKNet.EfCore.Events" Version="10.1.10" />
<PackageReference Include="DKNet.EfCore.Events" />
paket add DKNet.EfCore.Events --version 10.1.10
#r "nuget: DKNet.EfCore.Events, 10.1.10"
#:package DKNet.EfCore.Events@10.1.10
#addin nuget:?package=DKNet.EfCore.Events&version=10.1.10
#tool nuget:?package=DKNet.EfCore.Events&version=10.1.10
DKNet.EfCore.Events
Dispatches domain events raised by entities during EF Core SaveChanges. An entity queues a plain object from a
business method (AddEvent(...)); this package publishes it after the save has actually committed — never
before, never for a save that fails.
Features
AddEvent(object)/AddEvent<TEvent>()on anyIEventEntity(already implemented byEntity<TKey>/EntityinDKNet.EfCore.Abstractions) to queue events from domain methods.- Automatic dispatch after a successful
SaveChanges, via anEventHookthat plugs into the same save pipeline asDKNet.EfCore.Hooks. [RaisesEvent]declared events — raise events by attribute instead of by hand, with noIEventEntityrequirement (needsDKNet.EfCore.DtoGeneratorfor the payload).IEventPublisher/DefaultEventPublisherabstraction — plug in any messaging technology; multiple publishers can be registered and all run per save.EventExceptionsurfaces missingIMapperregistrations and unresolved declared-event payloads instead of failing silently.
Install
dotnet add package DKNet.EfCore.Events
Quick start
public record OrderPlacedEvent(Guid OrderId, decimal Total);
public class Order : Entity<Guid>
{
public Order(Guid id, decimal total) : base(id)
{
Total = total;
AddEvent(new OrderPlacedEvent(id, total)); // queued, not dispatched yet
}
public decimal Total { get; private set; }
}
public sealed class LoggingEventPublisher(ILogger<LoggingEventPublisher> logger) : DefaultEventPublisher
{
public override Task PublishAsync(object eventObj, CancellationToken cancellationToken = default)
{
logger.LogInformation("Publishing {EventType}", eventObj.GetType().Name);
return Task.CompletedTask;
}
}
// Startup — DbContext must be hook-aware for events to dispatch at all
services.AddDbContextWithHook<AppDbContext>((_, o) => o.UseSqlServer(connectionString));
services.AddEventPublisher<AppDbContext, LoggingEventPublisher>();
// Usage
db.Orders.Add(new Order(Guid.NewGuid(), 42.00m));
await db.SaveChangesAsync(); // OrderPlacedEvent reaches LoggingEventPublisher only after this commits
Full documentation
Registration details, the complete dispatch lifecycle, [RaisesEvent] declared events, configuration, and how
this composes with DKNet.EfCore.Abstractions and DKNet.EfCore.Hooks:
https://github.com/baoduy/DKNet/blob/dev/docs/EfCore/DKNet.EfCore.Events.md
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- DKNet.EfCore.Abstractions (>= 10.1.10)
- DKNet.EfCore.Hooks (>= 10.1.10)
- FluentResults (>= 4.0.0)
- Mapster (>= 10.0.12)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DKNet.EfCore.Events:
| Package | Downloads |
|---|---|
|
DKNet.SlimBus.Extensions
DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.10 | 47 | 8/22/2026 |
| 10.1.9 | 56 | 8/22/2026 |
| 10.1.8 | 46 | 8/21/2026 |
| 10.1.7 | 60 | 8/21/2026 |
| 10.1.6 | 54 | 8/21/2026 |
| 10.1.5 | 75 | 8/20/2026 |
| 10.1.4 | 63 | 8/20/2026 |
| 10.1.3 | 67 | 8/19/2026 |
| 10.1.2 | 69 | 8/19/2026 |
| 10.1.1 | 59 | 8/19/2026 |
| 10.0.36 | 90 | 8/18/2026 |
| 10.0.35 | 100 | 8/5/2026 |
| 10.0.34 | 98 | 8/5/2026 |
| 10.0.33 | 107 | 8/4/2026 |
| 10.0.32 | 342 | 8/3/2026 |
| 10.0.31 | 129 | 7/21/2026 |
| 10.0.30 | 124 | 7/21/2026 |
| 10.0.29 | 679 | 6/22/2026 |
| 10.0.27 | 194 | 5/22/2026 |
| 10.0.26 | 123 | 5/19/2026 |