0
bulutyonetim created
Hi,
I need to get which properties of enitity is being update in domain updating event, I there anyway for this?
I also tired this way but no hope, userBeforeUpdate have updated values not the orginal values.
[UnitOfWork]
public void HandleEvent(EntityUpdatingEventData<AbpUserBase> eventData)
{
using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.MayHaveTenant))
{
//Get all users
IQueryable<User> allUser = _userRepository.GetAll();
var userBeforeUpdate = allUser.FirstOrDefault(ua => ua.Id == eventData.Entity.Id && (ua.UserName == eventData.Entity.UserName || ua.EmailAddress == eventData.Entity.EmailAddress));
//user email is being activated
if (userBeforeUpdate.IsEmailConfirmed != eventData.Entity.IsEmailConfirmed && userBeforeUpdate.EmailConfirmationCode != eventData.Entity.EmailConfirmationCode)
{
}
}
}
2 Answer(s)
-
0
hi
You cannot get the changed properties in the EntityUpdatingEventData event.
You can trigger custom events in application services or domain services.
-
0
Hi, Thanks.