コード例 #1
0
        public BooksDisplayed UpdateBook(BooksDisplayed bookUpdate)
        {
            var book = _context.BooksInStore.Attach(bookUpdate);

            book.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            _context.SaveChanges();
            return(bookUpdate);
        }
コード例 #2
0
        public BooksDisplayed DeleteBook(int?Id)
        {
            BooksDisplayed book = _context.BooksInStore.Find(Id);

            if (book != null)
            {
                _context.BooksInStore.Remove(book);
                _context.SaveChanges();
            }
            return(book);
        }
コード例 #3
0
 public BooksDisplayed AddBook(BooksDisplayed books)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 public BooksDisplayed UpdateBook(BooksDisplayed bookUpdate)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
 public BooksDisplayed AddBook(BooksDisplayed book)
 {
     _context.BooksInStore.Add(book);
     _context.SaveChanges();
     return(book);
 }