Esempio n. 1
0
        public async Task <List <EMoneda> > ListarAsync()
        {
            var _client = new HttpClient();

            _client.BaseAddress = new Uri(_BaseUrl);


            var request = AppClient.RestRequest("api/Moneda/Listar", HttpMethod.Get, null);

            var response = await _client.SendAsync(request);


            if (response.IsSuccessStatusCode)
            {
                return(JsonConvert.DeserializeObject <List <EMoneda> >(await response.Content.ReadAsStringAsync()));
            }
            else
            {
                throw new Exception(await response.Content.ReadAsStringAsync());
            }
        }