private async Task PublishUserChangedEventBus(AppUser user) { if (_userContext.Entry(user).Property(u => u.Name).IsModified || _userContext.Entry(user).Property(u => u.Title).IsModified || _userContext.Entry(user).Property(u => u.Company).IsModified || _userContext.Entry(user).Property(u => u.Avatar).IsModified) { var userChangeEvent = new UserInfoChangedIntegrationEvent(user); await _userIntegrationEventService.PublishThroughEventBusAsync(userChangeEvent); } }
private void PublishUserInfoChangedIntegrationEvent(User user) { var userInfoChanged = new UserInfoChangedIntegrationEvent(user.Id, user.Name, user.Email); _eventBus.PublishThroughEventBusAsync(userInfoChanged); }