Exemplo n.º 1
0
        public async Task <ResultResponse> Post(
            [FromBody] GameRequest request
            , [FromServices] IGameService service)
        {
            try
            {
                if (request.IsValid())
                {
                    var result = await service.HasWinner(request.Matrix);

                    return(ResultResponse.CreateSuccess(result));
                }

                return(ResultResponse.CreateError(Constants.errorMessageInvalidMatrix));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.ToString(), "GameController.Post");

                throw ex;
            }
        }