-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EntityFrameworkCore.Triggered in the tools & extensions list #2913
Comments
Out of curiosity, how would you compare this to the SaveChanges events and interceptors introduced in EF Core 5.0? |
@roji Triggers are fundamentally higher up the stack. They are individual units of work that are strongly typed and are invoked for specific entities and change types (e.g. intercepting a modified Customer entity). Interceptors are much lower in the stack and a more generalised driver invoked for calls To SaveChanges. In fact, since V2 of this project, Triggers are built on top of SaveChanges interception, before (v1, targeting EFCore 3.1 required overriding SaveChanges/SaveChangesAsync or implementing the TriggeredDbContext). Some advantages of triggers over SaveChanges interception:
Perhaps a good example for seeing the power of triggers: https://github.com/koenbeuk/EntityFrameworkCore.Triggered/tree/master/samples/v2/3%20-%20StudentManagerAspNetCore |
@koenbeuk Feel free to submit a PR for this. We don't typically add these things ourselves, we just take PRs from the community. Make sure to keep the formatting. etc. consistent with other extensions in the page. |
I've recently published v2 of a project called EntityFrameworkCore.Triggered which lets you code triggers (similar to SQL Server triggers) within an EF domain. It allows you to run arbitrary code in response to changes within your SaveChanges cycle (both before and after SaveChanges happened). Its somewhat similar to Ramses which is already listed in the docs, but on steroids, as it supports full DI integration, Async out of the box, as well as recursion (a BeforeSave trigger could modify the ChangeSet which in return would invoke additional triggers). Given that the plugin is designed to solely add-on to the foundation of EFCore while minimising the number of new concepts introduced, I think its a fair candidate to be noted in the docs. Please consider adding it and driving traffic to the project.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: