Example #1
0
        public IActionResult CreateGenre([FromBody] Genre genre)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            library.AddGenre(genre);

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