abpframework / abpframework/abp
Introduce bulk entity events
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 3.7k
- Avg merge
- 15h 32m
- Merged PRs (30d)
- 106
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
consider this scenario:
you have a separate algolia search server, and you want to sync data between your database and the algolia index.
the current solution is to implement ILocalEventHandler<EntityChangedEventData<TEntity>>.
this works when only a single entity is getting changed, but not for InsertMany,UpdateMany,DeleteMany since they will introduce the N+1 problem
Describe the solution you'd like
I suggest that new events to get introduced:
IBulkEntityChangeEventHelperpublic interface IBulkEntityChangeEventHelper { void PublishEntityCreatedEvent(IEnumerable<object> entity); void PublishEntityUpdatedEvent(IEnumerable<object> entity); void PublishEntityDeletedEvent(IEnumerable<object> entity); }BulkEntityEventData-> contains a list of entitiesBulkEntityChangedEventData-> fired when many entities are changedBulkEntityCreatedEventData-> fired when many entities are createdBulkEntityUpdatedEventData-> fired when many entities are updatedBulkEntityDeletedEventData-> fired when many entities are deleted
and then we can add a configuration for users to override the behavior of InsertMany, UpdateMany,DeleteMany to control whether the old events EntityChangedEventData are fired alongside the new bulk ones or not
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the InsertMany, UpdateMany, and DeleteMany entry points and the existing EntityChangedEventData flow. Review how the proposed IBulkEntityChangeEventHelper and bulk event data types would integrate with those operations. Done means bulk events avoid the N+1 problem and configuration clearly defines whether the existing single-entity events are also published.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100