0
ErenSongur created
When I change the user's information or add a new user, it enters EntityChangingEventData's HandleEventAsync method more than once. But when we use this method in other tables, it is entered once.
The method:
public async Task HandleEventAsync(EntityChangingEventData<IdentityUser> eventData) { throw new NotImplementedException(); }
- ABP Framework version: v3.2.0
- UI type: Angular
- Identity Server Seperated (Angular): yes
4 Answer(s)
-
0
Hi,
Do you mean you only changed
IdentityUser
once but the event was triggered multiple times? -
0
Yes, exactly like that
-
0
ok. I will check it out.
-
0
Hi,
When you create a user, there are actually two processes
- Creating a user will trigger the created event. see: https://github.com/abpframework/abp/blob/01a7c4738508aa348784964e73d6c1ed4eeec314/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs#L180
- Add role to user will trigger updated event. see: https://github.com/abpframework/abp/blob/01a7c4738508aa348784964e73d6c1ed4eeec314/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs#L81
So it will trigger two events. But if you only update the user, the event will only be triggered once.