コード例 #1
0
 public void RemoveCustomer(Customer customer)
 {
     using var context = new LibraryContext();
     context.Custumers.Remove(customer);
     context.SaveChanges();
 }
コード例 #2
0
 public void RemoveBook(Book book)
 {
     using var context = new LibraryContext();
     context.Books.Remove(book);
     context.SaveChanges();
 }
コード例 #3
0
 public void UpdateCondition(Book book, byte newCondition)
 {
     using var context = new LibraryContext();
     book.Condition    = newCondition;
     context.SaveChanges();
 }
コード例 #4
0
 public void MoveBook(Book book, int shelfID)
 {
     using var context = new LibraryContext();
     book.ShelfID      = shelfID;
     context.SaveChanges();
 }