Exemplo n.º 1
0
        public Task <Unit> Handle(DeleteUserCommand command, CancellationToken cancellationToken)
        {
            if (!command.IsValid())
            {
                NotifyValidationErrors(command);
                return(Unit.Task);
            }

            _userRepository.Delete(command.Id);
            if (Commit())
            {
                // raise event
            }

            return(Unit.Task);
        }