コード例 #1
0
    public async Task <OperationResult> Handle(UpdateProjetoCommand request, CancellationToken cancellationToken)
    {
        _unitOfWork.ProjetoRepository.Update(_mapper.Map <Projeto>(request.Projeto));

        bool success = await _unitOfWork.SaveChangesAsync();

        OperationResult result = success ? OperationResult.Success : OperationResult.Failed;

        return(result);
    }
コード例 #2
0
 public async UnaryResult <OperationResult> UpdateAsync(UpdateProjetoCommand command)
 {
     return(await _mediator.Send(command));
 }