Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            bool result = false;
            ExternalCatalogBook book = obj as ExternalCatalogBook;

            if (book != null && (Id.Equals(book.Id) || Equals(book)))
            {
                result = true;
            }
            return(result);
        }
Ejemplo n.º 2
0
        private bool Equals(ExternalCatalogBook book)
        {
            bool equals = Title.Equals(book.Title);

            equals &= HasAuthor() && book.HasAuthor() || !HasAuthor() && !book.HasAuthor();
            equals &= HasKeywords() && book.HasKeywords() || !HasKeywords() && !book.HasKeywords();
            if (equals && HasAuthor())
            {
                equals &= Author.Equals(book.Author);
            }
            if (equals && HasKeywords())
            {
                equals &= Keywords.Equals(book.Keywords);
            }
            return(equals);
        }