Beispiel #1
0
        public async Task <IActionResult> Get(GameId gameId)
        {
            var result = await _pathService.GetPathsAsync(gameId);

            return(result.Map <IActionResult>(
                       Ok,
                       readGameError =>
            {
                return readGameError switch
                {
                    ReadGameError.NotFound => NotFound("Game not found"),
                    _ => throw new ArgumentOutOfRangeException(nameof(readGameError), readGameError, null)
                };
            }));