예제 #1
0
파일: Books.cs 프로젝트: nickmwise/Library
        public override bool Equals(System.Object otherBooks)
        {
            if (!(otherBooks is Books))
            {
                return(false);
            }
            else
            {
                Books newBooks        = (Books)otherBooks;
                bool  titleEquality   = this.GetTitle() == newBooks.GetTitle();
                bool  idEquality      = this.GetId() == newBooks.GetId();
                bool  authorEquality  = this.GetAuthor() == newBooks.GetAuthor();
                bool  dueDateEquality = this.GetDueDate() == newBooks.GetDueDate();

                return(titleEquality && idEquality && authorEquality && dueDateEquality);
            }
        }