public ActionResult CreateMatrix(MatrixSize matrixSize) { if (matrixSize == null || matrixSize.Range <= 0 || matrixSize.Range > 26) { return(BadRequest("Invalid matrix size. Required size: 0 < matrixSize <= 26")); } if (_gameLifetimeService.GetGameState() == GameState.Finished) { _gameLifetimeService.ClearGame(); } _creationService.CreateMatrix(matrixSize.Range); return(Ok()); }