public Task <bool> Handle(RemoveTreatmentRoomCommand request, CancellationToken cancellationToken) { if (!request.IsValid()) { NotifyValidationErrors(request); return(Task.FromResult(false)); } _treatmentRoomRepository.Remove(request.Id); if (Commit()) { _mediator.RaiseEvent(new TreatmentRoomRemovedEvent(request.Id)); } return(Task.FromResult(true)); }
public void Remove(Guid id) { var removeTreatmentRoomCommand = new RemoveTreatmentRoomCommand(id); _mediator.SendCommand(removeTreatmentRoomCommand); }