Exemplo n.º 1
0
 public Money GetValueInCurrency(Money money, string targetCurrency)
 {
     return(new Money(
                _exchangeRateRepository.GetExchangeRate(money.Currency, targetCurrency) * money.Value,
                targetCurrency));
 }
Exemplo n.º 2
0
 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);
        }