Beispiel #1
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());
        }
Beispiel #2
0
        public async Task <ActionResult <IEnumerable <Mode> > > GetModes()
        {
            var modes = await _modeService.GetModeListAsync();

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

            return(Ok(modes));
        }
Beispiel #3
0
        public async Task OnGet()
        {
            Modes = await _modeService.GetModeListAsync();

            if (Modes == null)
            {
                Modes = new List <Mode>();
            }

            if (!string.IsNullOrEmpty(SearchString))
            {
                Modes = Modes.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());
        }