public override bool Equals(System.Object otherItem) { if (!(otherItem is Book)) { return(false); } else { Book newBook = (Book)otherItem; bool idEquality = (this.GetId() == newBook.GetId()); bool titleEq = (this.GetTitle() == newBook.GetTitle()); bool yearEq = (this.GetYear() == newBook.GetYear()); return(idEquality && titleEq && yearEq); } }
public override bool Equals(System.Object otherBook) { if (!(otherBook is Book)) { return(false); } else { Book newBook = (Book)otherBook; bool areIdsEqual = (this.GetId() == newBook.GetId()); bool areNameEqual = (this.GetName() == newBook.GetName()); bool areauthor_idEqual = (this.GetAuthorId() == newBook.GetAuthorId()); bool areYearEqual = (this.GetYear() == newBook.GetYear()); return(areIdsEqual && areNameEqual && areauthor_idEqual && areYearEqual); } }