예제 #1
0
        public Task Handle(RemoveProspectCommand notification, CancellationToken cancellationToken)
        {
            notification.FillEntities();

            if (notification.Invalid)
            {
                NotifyValidationErrors(notification);
                return(Task.CompletedTask);
            }

            prospectRepository.Delete(notification.ProspectId);

            if (Commit())
            {
                return(Task.CompletedTask);
            }
            else
            {
                _bus.RaiseEvent(new DomainNotification(notification.MessageType, "Não foi possivel alterar cliente."));
                return(Task.CompletedTask);
            }
        }
예제 #2
0
        public void Remove(Guid id)
        {
            var removeCommand = new RemoveProspectCommand(id);

            _bus.SendCommand(removeCommand);
        }