Example #1
0
        public static async Task <double> GetPrice_Extension(this ICryptoCompare service, string crypto, string currency)
        {
            double price = 0;

            try {
                var response = await service.GetPrice(crypto, currency);

                var data = response.ToString();
                double.TryParse(data.Split(":")[1].Replace("}", ""), out price);
                return(price);
            }
            catch (Exception ex) {
                return(price);
            }
        }