public async Task <OperationResult> Handle(UpdateTarefaCommand request, CancellationToken cancellationToken) { _unitOfWork.TarefaRepository.Update(_mapper.Map <Tarefa>(request.Tarefa)); bool success = await _unitOfWork.SaveChangesAsync(); OperationResult result = success ? OperationResult.Success : OperationResult.Failed; return(result); }
public async UnaryResult <OperationResult> UpdateAsync(UpdateTarefaCommand command) { return(await _mediator.Send(command)); }
public Task <int> Update(UpdateTarefaCommand command) => _mediator.Send(command);