private ContaContract BuscarConta(HttpClient client, int idUser, string urlBaseApi) { var contaContract = new ContaContract(); var urlCompleta = urlBaseApi + string.Format("contadigital/BuscaContaPorUsuario/{0}", idUser); HttpResponseMessage response = client.GetAsync( urlCompleta).Result; string conteudo = response.Content.ReadAsStringAsync().Result; if (response.StatusCode == HttpStatusCode.OK) { contaContract = JsonConvert.DeserializeObject <ContaContract>(conteudo); } return(contaContract); }
private ContaContract BuscarContaAgenciaCC(HttpClient client, string agencia, string contacorrente, string urlBaseApi) { var contaContract = new ContaContract(); var urlCompleta = urlBaseApi + string.Format("contadigital/BuscaContaPorAgenciaCC/?agencia={0}&contacorrente={1}", agencia, contacorrente); HttpResponseMessage response = client.GetAsync( urlCompleta).Result; string conteudo = response.Content.ReadAsStringAsync().Result; if (response.StatusCode == HttpStatusCode.OK) { contaContract = JsonConvert.DeserializeObject <ContaContract>(conteudo); } return(contaContract); }