public Task Handle(RemoveAmigoCommand message, CancellationToken cancellation) { if (!message.IsValid()) { NotifyValidationErrors(message); return(Unit.Task); } _amigoRepository.Remove(message.Id); if (Commit()) { Bus.RaiseEvent(new AmigoRemovedEvent(message.Id)); } return(Unit.Task); }
public void Remove(Guid id) { var removeCommand = new RemoveAmigoCommand(id); Bus.SendCommand(removeCommand); }