コード例 #1
0
        public override int GetHashCode()
        {
            int result = base.GetHashCode();

            result = (result * 397) ^ LibraryId.GetHashCode();
            result = (result * 397) ^ LibraryName.GetHashCode();
            result = (result * 397) ^ LibraryPicture.GetHashCode();
            result = (result * 397) ^ Title.GetHashCode();
            result = (result * 397) ^ Author.GetHashCode();
            result = (result * 397) ^ Isbn.GetHashCode();
            result = (result * 397) ^ PublishYear.GetHashCode();
            return(result);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            var other = (BookSearchResult)obj;

            return(LibraryId.Equals(other.LibraryId) &&
                   LibraryName.Equals(other.LibraryName) &&
                   LibraryPicture.Equals(other.LibraryPicture) &&
                   Title.Equals(other.Title) &&
                   Author.Equals(other.Author) &&
                   PublishYear.Equals(other.PublishYear) &&
                   Isbn.Equals(other.Isbn));
        }