Ejemplo n.º 1
0
        public MarketPriceInfo GetMarketPrice(string currency, string cryptoName)
        {
            var dac   = new PriceInfoDAC();
            var price = dac.GetPrice(currency, cryptoName).Select(s =>
            {
                if (s != null)
                {
                    return new MarketPriceInfo
                    {
                        CryptoName = s.CryptoName,
                        Currency   = s.Currency,
                        Price      = s.Price
                    }
                }
                ;
                return(null);
            }).FirstOrDefault() ?? new MarketPriceInfo
            {
                CryptoName  = cryptoName,
                Currency    = currency,
                MarkupPrice = 0.0001M,
                Price       = 0.0001M
            };

            return(price);
        }
Ejemplo n.º 2
0
        public List <MarketPriceInfo> GetMarketPrice(string currency)
        {
            var dac = new PriceInfoDAC();

            var list = dac.GetPrice(currency).Select(s => new MarketPriceInfo {
                CryptoName = s.CryptoName, Currency = s.Currency, Price = s.Price
            }).ToList();

            return(list);
        }