public IHttpActionResult CreateGenre([FromBody] GenreModel genre) { if (!ModelState.IsValid) { return(BadRequest("Invalid genre")); } var list = _Book.CreateGenre(genre); if (!list) { return(BadRequest("Coudln't add the genre")); } return(Ok()); }