コード例 #1
0
        public override async Task InitializeAsync()
        {
            if (_ratesService.Banks == null)
            {
                await _ratesService.UpdateRatesInfoAsync().ConfigureAwait(false);
            }

            var averageRates = _ratesService.GetAvarageRates();

            var nbu = _ratesService.Banks[BankId.NBU];

            DollarPurchaseRate = averageRates.USD.Purchase.ToString();
            DollarSellRate     = averageRates.USD.Sell.ToString();
            EuroPurchaseRate   = averageRates.EUR.Purchase.ToString();
            EuroSellRate       = averageRates.EUR.Sell.ToString();

            OfficialExchangeRate = nbu.CurrencyRates.PLN.Purchase.ToString();
        }