Esempio n. 1
0
        public ActionResult <Game> Create([FromBody] Game game)
        {
            Game newGame = _gr.CreateGame(game);

            if (newGame == null)
            {
                return(BadRequest("haters gonna hate"));
            }
            return(Ok(newGame));
        }
Esempio n. 2
0
        public HttpResponseMessage CreateGame(string sessionKey, [FromBody] CreateGameModel gameModel)
        {
            var response = this.PerformOperation(() =>
            {
                var userId = UsersRepository.LoginUser(sessionKey);
                GamesRepository.CreateGame(userId, gameModel);
            });

            return(response);
        }