示例#1
0
        public Task Handle(RemoveAdressCommand message, CancellationToken cancellationToken)
        {
            if (!message.IsValid())
            {
                NotifyValidationErrors(message);
                return(Task.CompletedTask);
            }

            _adressRepository.Remove(message.AddressId);

            if (Commit())
            {
                Bus.RaiseEvent(new AdressRemovedEvent(message.AddressId));
            }

            return(Task.CompletedTask);
        }
示例#2
0
        public void Remove(int id)
        {
            var removeCommand = new RemoveAdressCommand(id);

            Bus.SendCommand(removeCommand);
        }