コード例 #1
0
 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);
     }
 }