Пример #1
0
        public static async Task <IEnumerable <CurrencyBO> > GetCurrenciesAsync(provider provider)
        {
            Task t = Task.Factory.StartNew(() => CurrencyUpdater.UpdateCurrencies(provider));

            t.Wait();

            IEnumerable <CurrencyDO> Currencies = await CurrencyDAL.GetCurrenciesAsync(provider);

            return(Currencies.Select(x => new CurrencyBO()
            {
                CurrencyLastUpdate = x.CurrencyLastUpdate,
                CurrencyName = x.CurrencyName,
                CurrencyService = x.CurrencyService,
                CurrencyValue = x.CurrencyValue
            }).ToList());
        }
Пример #2
0
        public static void UpdateCurrenciesAsync(provider provider)
        {
            Task t = Task.Factory.StartNew(() => CurrencyUpdater.UpdateCurrenciesService(provider));

            t.Wait();
        }