public Task <bool> Handle(RemoveBongCommand message, CancellationToken cancellationToken) { if (!message.IsValid()) { NotifyValidationErrors(message); return(Task.FromResult(false)); } _BongRepository.Remove(message.Id); if (Commit()) { Bus.RaiseEvent(new BongRemovedEvent(message.Id)); } return(Task.FromResult(true)); }
public void Remove(Guid id) { var removeCommand = new RemoveBongCommand(id); Bus.SendCommand(removeCommand); }