public async Task <IActionResult> OnGet(Guid id) { if (id == null) { return(BadRequest()); } Game = await _gameService.GetGameByIdAsync(id); if (Game == null) { return(NotFound()); } return(Page()); }
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()); }
public async Task <ActionResult <Game> > GetGame(Guid id) { var game = await _gamesService.GetGameByIdAsync(id); if (game == null) { return(NotFound()); } return(game); }