예제 #1
0
        public ExchangeRate GetLiveExchangeRate(string source, string quote)
        {
            var quotes = _currencyProvider.GetQuotes();

            if (quotes.ContainsKey($"{source}{quote}"))
            {
                var exchangeRate = new ExchangeRate
                {
                    LastUpdateInUtc = DateTime.Now.ToUniversalTime(),
                    Quote           = quote,
                    Source          = source,
                    Rate            = (decimal)quotes[$"{source}{quote}"]
                };

                return(exchangeRate);
            }

            return(null);
        }