Exemplo n.º 1
0
        public async Task <IHttpActionResult> UpdateCellAndGetBoardStatusAsync(int playerBoardId, [FromBody] UpdateCellRequest request)
        {
            try
            {
                var status = await processService.UpdateCellAndGetBoardStatusAsync(playerBoardId, request);

                return(Ok(status));
            }
            catch (CannotUpdateCellException ex)
            {
                logger.Error(ex, ex.Message);
                return(BadRequest(ex.Message));
            }
            catch (BoardNotFoundException ex)
            {
                logger.Error(ex, $"Board with {playerBoardId} can not be found.");
                return(NotFound());
            }
        }
        /// <inheritdoc/>
        public Task <BoardStatus> UpdateCellAndGetBoardStatusAsync(int playerBoardId, UpdateCellRequest request)
        {
            ValidateUpdateCellRequest(playerBoardId, request);

            return(validatedService.UpdateCellAndGetBoardStatusAsync(playerBoardId, request));
        }