public async Task <IActionResult> StartGame()
        {
            var user = await _repository.GetByIdAsync(ApplicationUtilities.GetUserIdFromHttpContext(HttpContext));

            //At the moment there is no way of inviting, so I'm using an internal dummy User as opponent
            var gameId = _chessService.StartGame(user, new Data.DataEntities.User());

            return(Ok(gameId));
        }
        public async Task <IActionResult> GetMoves([FromBody] GetValidPositionsModel getValidPositionsModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var user = await _repository.GetByIdAsync(ApplicationUtilities.GetUserIdFromHttpContext(HttpContext));

            return(Ok(_chessService.GetPossiblePositions(user, getValidPositionsModel.GameId, getValidPositionsModel.Position)));
        }
 public async Task <IActionResult> GetMe()
 {
     return(Ok(await _userService.GetByIdAsync(ApplicationUtilities.GetUserIdFromHttpContext(HttpContext))));
 }