public Money GetValueInCurrency(Money money, string targetCurrency) { return(new Money( _exchangeRateRepository.GetExchangeRate(money.Currency, targetCurrency) * money.Value, targetCurrency)); }
public IActionResult Index(int?currencyInId, int?currencyOutId) { TempData["InId"] = currencyInId; TempData["OutId"] = currencyOutId; return(View(_repository.GetExchangeRate(currencyInId, currencyOutId))); }
public decimal Exchange(string fromCurrency, string toCurrency, decimal value) { var rate = _exchangeRateRepository.GetExchangeRate(fromCurrency, toCurrency).Result; return(value * rate); }