Exemplo n.º 1
0
    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));
 }
Exemplo n.º 3
0
 public Task <int> Update(UpdateTarefaCommand command) => _mediator.Send(command);