Exemplo n.º 1
0
        public async Task <IActionResult> Task3()
        {
            HttpContext.Response.Cookies.Append(_currentPageCookieName, "3");

            // Note from RexGex: for now, I'm just gonna put a blanket try-catch statement for this task, so the page will at least render.
            // #TODO: Remove the try-catch statement once the task is completed.
            try
            {
                var apiKey = "";

                // #TODO: Retrieve the list of asset (use the same service call form Task 2)

                // #TODO: Find an asset where both Value and Quantity are NULL

                // #TODO: Assign the asset Id here
                long?assetIdWithNulls = null;

                // Retrieve the history log. Note that the log entries may not be sorted.
                var response = await _terminalService.RetrieveAssetHistoryLog(apiKey, assetIdWithNulls);

                var historyLog = JsonConvert.DeserializeObject <IReadOnlyList <Task3GetAssetHistoryLogResponse> >(response);

                // #TODO: Find the last user that made changes to this asset based on history log

                // #TODO: Assign UserId, first name, last name of that user onto the view model below.
                return(View(new Task3ViewModel
                {
                    UserId = null,
                    UserFirstName = "",
                    UserLastName = ""
                }));
            }
            catch
            {
                return(View());
            }
        }