コード例 #1
0
        public async Task <IActionResult> AddPointsForMatch([FromBody] Points points)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                await pointsService.AddPointsForMatchAsync(points);

                return(Accepted());
            }
            catch (NotFoundInDatabaseException)
            {
                return(NotFound());
            }
            catch (AlreadyInDatabaseException)
            {
                return(Conflict());
            }
            catch (ArgumentOutOfRangeException)
            {
                return(StatusCode(406));
            }
            catch (ArgumentException)
            {
                return(ValidationProblem());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }