public IActionResult Create([FromBody] Shelf shelf)
        {
            _context.Shelf.Add(shelf);
            _context.SaveChanges();

            return(CreatedAtRoute("GetShelf", new { id = shelf.Id }, shelf));
        }
        public IActionResult Create([FromBody] Bookshelf bookshelf)
        {
            _context.Bookshelf.Add(bookshelf);
            _context.SaveChanges();

            return(CreatedAtRoute("GetBookShelf", new { id = bookshelf.Id }, bookshelf));
        }
        public IActionResult Create([FromBody] Author author)
        {
            _context.Author.Add(author);
            _context.SaveChanges();

            return(CreatedAtRoute("GetCreatedAuthor", new { id = author.Id }, author));
        }
Beispiel #4
0
        public IActionResult Create([FromBody] Genre genre)
        {
            _context.Genre.Add(genre);
            _context.SaveChanges();

            return(CreatedAtRoute("GetCreatedGenre", new { id = genre.Id }, genre));
        }
        public IActionResult Create([FromBody] User user)
        {
            _context.User.Add(user);
            _context.SaveChanges();

            return(CreatedAtRoute("GetUser", new { id = user.Id }, user));
        }
 public ActionResult <Book> Create([FromBody] Book book)
 {
     _context.Book.Add(book);
     _context.SaveChanges();
     return(CreatedAtRoute("GetCreatedBook", new { id = book.Id }, book));
 }