Ejemplo n.º 1
0
        /// <summary>
        /// Calculates hash code for current book
        /// </summary>
        /// <returns>Hash code of the book</returns>
        public override int GetHashCode()
        {
            int hashCode = 0;

            unchecked
            {
                hashCode = Title.GetHashCode() + Author.GetHashCode() + Genre.GetHashCode() +
                           NumberOfPages.GetHashCode() + Language.GetHashCode() + Country.GetHashCode();
            }
            return(hashCode);
        }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Id.GetHashCode();
            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + Authors.GetHashCode();
            hash = hash * 23 + NumberOfPages.GetHashCode();
            hash = hash * 23 + Publisher.GetHashCode();
            hash = hash * 23 + MediaType.GetHashCode();
            hash = hash * 23 + Country.GetHashCode();
            hash = hash * 23 + ReleaseDate.GetHashCode();
            hash = hash * 23 + PrecededBy.GetHashCode();
            hash = hash * 23 + FollowedBy.GetHashCode();

            return(hash);
        }