示例#1
0
        public async Task <ActionResult <CollaboratorViewModel> > GetByCpf([FromQuery] CollaboratorCpfViewModel collaborator)
        {
            var vm = await _collaboratorService.GetByCpfAsync(collaborator);

            if (vm == null)
            {
                return(NotFound());
            }

            return(Ok(vm));
        }
示例#2
0
 public async Task <CollaboratorViewModel> GetByCpfAsync(CollaboratorCpfViewModel collaboratorCpfViewModel)
 {
     return(_mapper.Map <CollaboratorViewModel>(await _collaboratorRepository.GetByCpf(collaboratorCpfViewModel.CPF)));
 }