public async Task <IActionResult> Index()
        {
            var sendmarquee = await _webApiFetch.WebApiFetchAsync("https://api.coinmarketcap.com/v1/ticker/?convert=EUR&limit=30");

            List <Crypto> cryptos = JsonConvert.DeserializeObject <List <Crypto> >(sendmarquee);

            return(View(cryptos));
        }
Esempio n. 2
0
        public async Task <DrawData> ApiOpapFetch()
        {
            var sendDraws = await _webApiFetch.WebApiFetchAsync("http://applications.opap.gr/DrawsRestServices/joker/last.json");

            //{"draw":{"drawTime":"22-03-2018T22:00:00","drawNo":1898,"results":[4,11,23,34,22,12]}}
            var stringLength = sendDraws.Length - 9;
            var temp         = sendDraws.Substring(8, stringLength);

            //After substring we take this json
            //{"drawTime":"22-03-2018T22:00:00","drawNo":1898,"results":[4,11,23,34,22,12]}
            //better for model biding
            return(JsonConvert.DeserializeObject <DrawData>(temp));
        }