예제 #1
0
        public async Task <IActionResult> OnGet(Guid id)
        {
            if (id == null)
            {
                return(BadRequest());
            }

            Game = await _gameService.GetGameByIdAsync(id);

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

            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnGet(Guid id)
        {
            if (id == null)
            {
                return(BadRequest());
            }

            Game = await _gameService.GetGameByIdAsync(id);

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

            var categories = await _categoryService.GetCategoryListAsync();

            ViewData["CategoryName"] = new SelectList(categories, "Id", "Name");

            var genres = await _genreService.GetGenreListAsync();

            ViewData["GenreName"] = new SelectList(genres, "Id", "Name");

            var modes = await _modeService.GetModeListAsync();

            ViewData["ModeName"] = new SelectList(modes, "Id", "Name");

            var platforms = await _platformService.GetPlatformsListAsync();

            ViewData["PlatformName"] = new SelectList(platforms, "Id", "Name");

            return(Page());
        }
예제 #3
0
        public async Task <ActionResult <Game> > GetGame(Guid id)
        {
            var game = await _gamesService.GetGameByIdAsync(id);

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

            return(game);
        }