Esempio n. 1
0
        public async Task <ActionResult <CryptoCurrencyDetails> > GetCryptoCurrency(int id)
        {
            var currency = await _cryptocurrencyRepository.GetAsync(id);

            if (currency == null)
            {
                return(NotFound());
            }

            var model = _cryptoCurrencyModelFactory.GetDetailsModel(currency);

            return(new JsonResult(model));
        }
        public async Task <IActionResult> Details(int id)
        {
            var currency = await _cryptocurrencyRepository.GetAsync(id);

            if (currency == null)
            {
                return(NotFound());
            }

            var model = _cryptoCurrencyModelFactory.GetDetailsModel(currency);

            return(View(model));
        }