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); }
public void Remove(int id) { var removeCommand = new RemoveAdressCommand(id); Bus.SendCommand(removeCommand); }