Esempio n. 1
0
        public IActionResult CreateGame()
        {
            ViewData["Message"] = "Create new game.";
            ViewBag.GameHeaders = _gameTypeService.GetGameTypes();

            return(View());
        }
        public async Task <IActionResult> GetGameTypes()
        {
            try
            {
                var gameTypes = await _gameTypeService.GetGameTypes();

                if (gameTypes != null)
                {
                    return(Ok(gameTypes));
                }
            }
            catch (Exception)
            {
                return(BadRequest("an error occured whilst trying to get all gameTypes"));
            }

            return(BadRequest("an error occured whilst getting gameTypes"));
        }
        public async Task <IActionResult> GetGameTypes()
        {
            var gameTypes = await GameTypeService.GetGameTypes();

            return(Ok(gameTypes));
        }