public void CreateGame() { var gameEntity = repo.Insert(new GameEntity(10)); Console.WriteLine(gameEntity.Id); gameEntity.Id.Should().NotBe(Guid.Empty); }
public IActionResult Create([FromBody] CreateGameDTO gameDto) { if (!HttpContext.User.Identity.IsAuthenticated) { return(Unauthorized()); } var game = new GameEntity(gameDto.IsOpen, gameDto.RoundsCount, gameDto.RoundTime, HttpContext.User.Identity.Name); _gameRepository.Insert(game); return(Created(game.GameId.ToString(), game)); }