Esempio n. 1
0
        public IActionResult Index(decimal amount, int idFrom, int idTo)
        {
            var result = currencyRepository.CalculateAmount(amount, idFrom, idTo);

            if (ModelState.IsValid)
            {
                var viewModel = new CurrencyFormViewModel
                {
                    Amount = amount,
                    Result = result
                };

                return(RedirectToAction("Index", viewModel));
            }

            return(NotFound());
        }