Ejemplo n.º 1
0
        public async Task <IActionResult> Task2()
        {
            HttpContext.Response.Cookies.Append(_currentPageCookieName, "2");

            // #TODO: Assign the API key obtain from task #1 here.
            var apiKey = "";

            if (string.IsNullOrEmpty(apiKey))
            {
                return(View());
            }

            var assetList = await _terminalService.RetrieveAssetList(apiKey);

            // #TODO: Redo the view model property values assignment below, so that the lists actually match the criteria
            var viewModel = new Task2ViewModel
            {
                Top4MostQuantityAssets = assetList,
                Top4MostValuableAssets = assetList,
            };

            return(View(viewModel));
        }