public async Task Atualizar(ResponsavelViewModel responsavelViewModel) { var responsavel = _mapper.Map <Responsavel>(responsavelViewModel); if (!ExecutarValidacao(new ResponsavelValidation(), responsavel)) { return; } if (_responsavelRepository.Buscar(r => r.Cpf == responsavel.Cpf && r.Id != responsavel.Id).Result.Any()) { Notificar("Já existe um responsável cadastrado com este CPF informado."); return; } _responsavelRepository.Atualizar(responsavel); await _responsavelRepository.UnitOfWork.Commit(); }
public async Task <IActionResult> EditarResponsavel(ResponsavelDTO responsavelEdita) { _responsavelRepository.Atualizar(_mapper.Map <Responsavel>(responsavelEdita)); return(CustomResponse(responsavelEdita)); }