public HttpResponseMessage GetImovelId(int id) { Imovel_bll imovelRepository = new Imovel_bll(_connection); bool _existe = imovelRepository.Existe_Imovel(id); if (!_existe) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Imóvel não cadastrado.")); } else { Imovel_Full _imovel = imovelRepository.Dados_Imovel_Full(id); string jsonString = JsonConvert.SerializeObject(_imovel); return(Request.CreateResponse(HttpStatusCode.OK, jsonString)); } }