예제 #1
0
        public Task Handle(RemoverPerfilCommand message, CancellationToken cancellationToken)
        {
            if (!message.IsValid())
            {
                NotifyValidationErrors(message);
                return(Task.CompletedTask);
            }

            _perfilRepository.Remove(message.Id);

            if (Commit())
            {
                Bus.RaiseEvent(new PerfilRemovedEvents(message.Id));
                return(Task.CompletedTask);
            }

            return(Task.CompletedTask);
        }
예제 #2
0
        public void Remove(Guid id)
        {
            var removeCommand = new RemoverPerfilCommand(id);

            _bus.SendCommand(removeCommand);
        }