Beispiel #1
0
        public IActionResult PostScore(int levelId, [FromBody] Score score)
        {
            if (!TryValidateModel(score))
            {
                return(BadRequest());
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _repository.AddScore(score, levelId);
            return(Created(Request.Path + score.Id.ToString(), score));
        }