Example #1
0
        public ActionResult <CepDTO> ValidateCep(string cep)
        {
            if (string.IsNullOrWhiteSpace(cep))
            {
                return(BadRequest());
            }

            CepDTO cepDTO = _cepService.GetAddressByCep(cep);

            if (cepDTO != null)
            {
                return(Ok(cepDTO));
            }

            return(NotFound());
        }
Example #2
0
        public IActionResult GetCep(string cep)
        {
            var address = _cepService.GetAddressByCep(cep);

            return(Ok(address));
        }