public bool DecrementBooksNum(int book_id) { Books book = _context.Books.SingleOrDefault(bo => bo.ID == book_id); if (book != null) { if (book.BookNo > 0) { book.BookNo = book.BookNo - 1; } else { return(false); } } _context.SaveChanges(); return(true); }
public void Save() { _context.SaveChanges(); }