Пример #1
0
        public IActionResult PostLevel([FromBody] Level level)
        {
            if (!TryValidateModel(level))
            {
                return(BadRequest());
            }

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

            _repository.AddLevel(level);
            return(Created(Request.Path + level.Id.ToString(), level));
        }