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 nameEquality  = this.GetName() == newBook.GetName();
         bool genreEquality = this.GetGenre() == newBook.GetGenre();
         return(idEquality && nameEquality && genreEquality);
     }
 }
Пример #2
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 genreEquality     = (this.GetGenre() == newBook.GetGenre());
                bool inventoryEquality = (this.GetInventory() == newBook.GetInventory());

                return(idEquality && titleEquality && genreEquality);
            }
        }