示例#1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                var hashCode = 41;

                // Suitable nullity checks etc, of course :)
#pragma warning disable CA1307 // Specify StringComparison

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Id != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Id.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Name != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Name.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Venue != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Venue.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Speakers != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Speakers.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Talks != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Talks.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Friends != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Friends.GetHashCode();
                }
#pragma warning restore CA1307 // Specify StringComparison
                return(hashCode);
            }
        }
示例#2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                var hashCode = 41;

                // Suitable nullity checks etc, of course :)
#pragma warning disable CA1307 // Specify StringComparison

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Id != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Id.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (FirstName != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + FirstName.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (LastName != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + LastName.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (CompanyName != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + CompanyName.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (CompanyUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + CompanyUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Description != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Description.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (BlogsUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + BlogsUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (ContactsUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + ContactsUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (TwitterUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + TwitterUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (HabrUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + HabrUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (GitHubUrl != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + GitHubUrl.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Meetups != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Meetups.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Venues != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Venues.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Talks != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Talks.GetHashCode();
                }

                // ReSharper disable once NonReadonlyMemberInGetHashCode
                if (Friends != null)
                {
                    // ReSharper disable once NonReadonlyMemberInGetHashCode
                    hashCode = (hashCode * 59) + Friends.GetHashCode();
                }
#pragma warning restore CA1307 // Specify StringComparison
                return(hashCode);
            }
        }
示例#3
0
 public override int GetHashCode() => Talks.GetHashCode();