public ActionResult <Familia> GetFamiliaById([FromHeader] string ibge, [FromRoute] int id) { try { ibge = _config.GetConnectionString(Helpers.Connection.GetConnection(ibge)); Familia item = _repository.GetFamiliaById(ibge, id); item.domicilio = _estabelecimentorepository.GetEstabelecimentoById(ibge, (int)item.id_domicilio); return(Ok(item)); } catch (Exception ex) { var response = TrataErro.GetResponse(ex.Message, true); return(StatusCode((int)HttpStatusCode.InternalServerError, response)); } }
public TbPrFamilia GetFamiliaById(int id) { return(repository.GetFamiliaById(id)); }