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
                    
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="DKNet.EfCore.Events" Version="10.1.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DKNet.EfCore.Events" Version="10.1.10" />
                    
Directory.Packages.props
<PackageReference Include="DKNet.EfCore.Events" />
                    
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 DKNet.EfCore.Events --version 10.1.10
                    
#r "nuget: DKNet.EfCore.Events, 10.1.10"
                    
#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 DKNet.EfCore.Events@10.1.10
                    
#: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=DKNet.EfCore.Events&version=10.1.10
                    
Install as a Cake Addin
#tool nuget:?package=DKNet.EfCore.Events&version=10.1.10
                    
Install as a Cake Tool

DKNet.EfCore.Events

NuGet License

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 any IEventEntity (already implemented by Entity<TKey> / Entity in DKNet.EfCore.Abstractions) to queue events from domain methods.
  • Automatic dispatch after a successful SaveChanges, via an EventHook that plugs into the same save pipeline as DKNet.EfCore.Hooks.
  • [RaisesEvent] declared events — raise events by attribute instead of by hand, with no IEventEntity requirement (needs DKNet.EfCore.DtoGenerator for the payload).
  • IEventPublisher / DefaultEventPublisher abstraction — plug in any messaging technology; multiple publishers can be registered and all run per save.
  • EventException surfaces missing IMapper registrations 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed