EfCore.GenericEventRunner 2.1.0-preview003

A library to provide domain event handling to EF Core.

This is a prerelease version of EfCore.GenericEventRunner.
There is a newer version of this package available.
See the version list below for details.
Install-Package EfCore.GenericEventRunner -Version 2.1.0-preview003
dotnet add package EfCore.GenericEventRunner --version 2.1.0-preview003
<PackageReference Include="EfCore.GenericEventRunner" Version="2.1.0-preview003" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EfCore.GenericEventRunner --version 2.1.0-preview003
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EfCore.GenericEventRunner, 2.1.0-preview003"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

EfCore.GenericEventRunner

This library allows users of Entity Framework Core (EF Core) to add events to their entity classes, i.e. the classes that EF Core maps to a database. It is useful if you have business rules that are tiggered by a property changing, or an event such as receiving an customer order and you need to check some things before you can accept it.

Version 2 how supports async event handlers and, via the EfCore.GenericEventRunner.DomainParts library, it can support a Clean Code architecture.

Preview 2.1 supports more sorts of events, including ones that run withing a transaction where SaveChanges is called. This allows you to implement Integration events across multiple parts of your application.

This is an open source project (MIT license) available on GitHub and as a NuGet package.

Useful articles

EfCore.GenericEventRunner

This library allows users of Entity Framework Core (EF Core) to add events to their entity classes, i.e. the classes that EF Core maps to a database. It is useful if you have business rules that are tiggered by a property changing, or an event such as receiving an customer order and you need to check some things before you can accept it.

Version 2 how supports async event handlers and, via the EfCore.GenericEventRunner.DomainParts library, it can support a Clean Code architecture.

Preview 2.1 supports more sorts of events, including ones that run withing a transaction where SaveChanges is called. This allows you to implement Integration events across multiple parts of your application.

This is an open source project (MIT license) available on GitHub and as a NuGet package.

Useful articles

Release Notes

- BREAKING CHANGE - the definitions of the events handler has changed. The callingEntity parameter is now an object.
     - BREAKING CHANGE - You now need to register exception handlers against the DbContext type. This allows different handlers for multiple DbContexts
     - New Feature: Added during event and event handlers. The event is called within a transaction.
     - New feature: DuringSaveStage attribute. Allows you move the during event from running after SaveChanges in the transaction to before the call to SaveChanges (but after DetectChanges has been called).
     - New Feature: You can now pick what types of events an entity supports by applying the approriate interfaces: IEntityWithBeforeSaveEvents, IEntityWithDuringSaveEvents, and IEntityWithAfterSaveEvents
     - New feature: You can inject a action to be run after DeteckChanges is called. Useful for adding last created/updated times.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.3.2 131 1/25/2021
2.3.1 52 1/22/2021
2.3.0 747 11/22/2020
2.2.2 107 11/10/2020
2.2.1 105 11/10/2020
2.2.0 103 11/9/2020
2.1.0 340 9/14/2020
2.1.0-preview005 90 8/28/2020
2.1.0-preview003 135 8/26/2020
2.1.0-preview002 116 8/25/2020
2.1.0-preview001 133 8/25/2020
2.0.0 146 8/12/2020
1.2.0 678 1/25/2020
1.1.0 383 12/3/2019
1.0.0 172 11/29/2019
Show less