コード例 #1
0
        public Task Handle(RemoverEscopoCommand message, CancellationToken cancellationToken)
        {
            if (!message.IsValid())
            {
                NotifyValidationErrors(message);
                return(Task.CompletedTask);
            }

            _escopoRepository.Remove(message.Id);

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

            return(Task.CompletedTask);
        }
コード例 #2
0
        public void Remove(Guid id)
        {
            var removeCommand = new RemoverEscopoCommand(id);

            Bus.SendCommand(removeCommand);
        }