Exemple #1
0
        public IActionResult CreateAuthor([FromBody] Author author)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            library.AddAuthor(author);

            return(CreatedAtAction("Get", new { id = author.Id }, author));
        }