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()); }
public IActionResult GetCep(string cep) { var address = _cepService.GetAddressByCep(cep); return(Ok(address)); }