Ejemplo n.º 1
0
 public TickerReposity()
 {
     _restClient = new HttpClient {
         BaseAddress = new Uri(Endpoints.CoinMarketCapApiUrl)
     };
     queryStringService = new QueryStringService();
     jsonParserService  = new JsonParserService();
 }
Ejemplo n.º 2
0
        public async Task <ListingsData> Get()
        {
            var querystringService = new QueryStringService();
            var jsonParserService  = new JsonParserService();

            var url      = querystringService.AppendQueryString(Endpoints.Listings, "");
            var response = await _restClient.GetAsync(url);

            return(await jsonParserService.ParseResponse <ListingsData>(response));
        }
Ejemplo n.º 3
0
        public async Task <GlobalData> Get(string convert)
        {
            var queryStringService = new QueryStringService();
            var jsonParserService  = new JsonParserService();
            var convertParam       = !string.IsNullOrWhiteSpace(convert) ? $"convert={convert}" : null;

            var url      = queryStringService.AppendQueryString(Endpoints.GlobalData, convertParam);
            var response = await _restClient.GetAsync(url);

            return(await jsonParserService.ParseResponse <GlobalData>(response));
        }