public async Task <ActionResult <CollaboratorViewModel> > GetByCpf([FromQuery] CollaboratorCpfViewModel collaborator) { var vm = await _collaboratorService.GetByCpfAsync(collaborator); if (vm == null) { return(NotFound()); } return(Ok(vm)); }
public async Task <CollaboratorViewModel> GetByCpfAsync(CollaboratorCpfViewModel collaboratorCpfViewModel) { return(_mapper.Map <CollaboratorViewModel>(await _collaboratorRepository.GetByCpf(collaboratorCpfViewModel.CPF))); }