public ActionResult Create(CurrencyRate currencyrate, string userid) { if (ModelState.IsValid) { ICR.Add(currencyrate, Session["userid"].ToString()); } return(View(currencyrate)); }
public async Task <List <CurrencyRate> > GetCurrencyRates(DateTime date, string currency, string currencyDefault) { List <CurrencyRate> currencyRates = _currencyRateRepository.GetCurrencyItems(date, currency, currencyDefault); if (currencyRates.Select(c => c.BankId).ToList().Distinct().Count() == 0) { IEnumerable <CurrencyRate> rates = await _bankClientDataProvider.GetRatesFromBanks(date); _currencyRateRepository.Add(rates); currencyRates.AddRange(rates); } return(currencyRates); }