public async Task <ActionResult <CollaborativeViewModel> > GetByCNPJ([FromQuery] CollaborativeCnpjViewModel collaborativeCnpjViewModel) { var collabVM = await _collaborativeService.GetByCnpjAsync(collaborativeCnpjViewModel); if (collabVM == null) { return(NotFound()); } return(Ok(collabVM)); }
public async Task <CollaborativeViewModel> GetByCnpjAsync(CollaborativeCnpjViewModel collaborativeCnpjViewModel) { var collab = _mapper.Map <CollaborativeViewModel>(await _collaborativeRepository.GetByCnpj(collaborativeCnpjViewModel.CNPJ)); return(collab); }