Exemplo n.º 1
0
 public override bool Equals(System.Object otherBook)
 {
     if (!(otherBook is Book))
     {
         return(false);
     }
     else
     {
         Book newBook              = (Book)otherBook;
         bool idEquality           = (this.GetId() == newBook.GetId());
         bool titleEquality        = (this.GetTitle() == newBook.GetTitle());
         bool callNumberEquality   = (this.GetCallNumber() == newBook.GetCallNumber());
         bool tagNumberEquality    = (this.GetTagNumber() == newBook.GetTagNumber());
         bool checkoutDateEquality = (this.GetCheckoutDate() == newBook.GetCheckoutDate());
         bool dueDateEquality      = (this.GetDueDate() == newBook.GetDueDate());
         bool statusEquality       = (this.GetStatus() == newBook.GetStatus());
         // return _id == newBook._id && _title == newBook._title && _callNumber == newBook._callNumber && _tagNumber == newBook._tagNumber && _checkoutDate == newBook._checkoutDate && _dueDate == newBook._dueDate && _status == newBook._status;
         return(idEquality && titleEquality && callNumberEquality && tagNumberEquality && checkoutDateEquality && dueDateEquality && statusEquality);
     }
 }