public IActionResult Update(string id, booksModel bookIn) { var book = _bookService.Get(id); if (book == null) { return(NotFound()); } _bookService.Update(id, bookIn); return(NoContent()); }
public void Remove(booksModel bookIn) => _books.DeleteOne(book => book.Id == bookIn.Id);
public void Update(string id, booksModel bookIn) => _books.ReplaceOne(book => book.Id == id, bookIn);
public booksModel Create(booksModel book) { _books.InsertOne(book); return(book); }
public ActionResult <booksModel> Create(booksModel book) { _bookService.Create(book); return(CreatedAtRoute("GetBook", new { id = book.Id.ToString() }, book)); }