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());
        }
Exemple #2
0
        public async Task <ActionResult <IEnumerable <Genre> > > GetGenres()
        {
            var genres = await _genreService.GetGenreListAsync();

            if (genres == null || genres.Count() == 0)
            {
                return(NoContent());
            }

            return(Ok(genres));
        }
Exemple #3
0
        public async Task OnGet()
        {
            Genres = await _genreService.GetGenreListAsync();

            if (Genres == null)
            {
                Genres = new List <Genre>();
            }

            if (!string.IsNullOrEmpty(SearchString))
            {
                Genres = Genres.Where(s => s.Name.Contains(SearchString));
            }
        }
        public async Task <IActionResult> OnGet()
        {
            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());
        }