public override bool Equals(System.Object otherBook) { if (!(otherBook is Book)) { return(false); } else { Book newBook = (Book)otherBook; bool imageEquality = this.GetImage() == newBook.GetImage(); bool authorEquality = this.GetAuthor() == newBook.GetAuthor(); bool nameEquality = this.GetName() == newBook.GetName(); bool isbnEquality = this.GetIsbn() == newBook.GetIsbn(); bool publisherEquality = this.GetPublisher() == newBook.GetPublisher(); bool priceEquality = this.GetPrice() == newBook.GetPrice(); bool quantEquality = this.GetQuantity() == newBook.GetQuantity(); return(imageEquality && authorEquality && nameEquality && isbnEquality && publisherEquality && priceEquality && quantEquality); } }