Exemple #1
0
        public async Task DeleteAsync(Guid userId)
        {
            var user = await _userRepository.GetByIdAsync(userId);

            _subscriber.Subscribe <UserDeletedEvent>(async domainEvent => await HandleAsync(_userDeleteEventHandlers, domainEvent));
            user.Delete(userId);
            await _userRepository.DeleteAsync(user);
        }