Esempio n. 1
0
        public IActionResult Update(string id, booksModel bookIn)
        {
            var book = _bookService.Get(id);

            if (book == null)
            {
                return(NotFound());
            }

            _bookService.Update(id, bookIn);

            return(NoContent());
        }
Esempio n. 2
0
 public void Remove(booksModel bookIn) =>
 _books.DeleteOne(book => book.Id == bookIn.Id);
Esempio n. 3
0
 public void Update(string id, booksModel bookIn) =>
 _books.ReplaceOne(book => book.Id == id, bookIn);
Esempio n. 4
0
 public booksModel Create(booksModel book)
 {
     _books.InsertOne(book);
     return(book);
 }
Esempio n. 5
0
        public ActionResult <booksModel> Create(booksModel book)
        {
            _bookService.Create(book);

            return(CreatedAtRoute("GetBook", new { id = book.Id.ToString() }, book));
        }