예제 #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks

                hash = hash * 59 + Id.GetHashCode();

                if (GivenName != null)
                {
                    hash = hash * 59 + GivenName.GetHashCode();
                }

                if (Surname != null)
                {
                    hash = hash * 59 + Surname.GetHashCode();
                }

                if (OrganizationName != null)
                {
                    hash = hash * 59 + OrganizationName.GetHashCode();
                }

                if (Role != null)
                {
                    hash = hash * 59 + Role.GetHashCode();
                }

                if (Notes != null)
                {
                    hash = hash * 59 + Notes.GetHashCode();
                }

                if (EmailAddress != null)
                {
                    hash = hash * 59 + EmailAddress.GetHashCode();
                }

                if (WorkPhoneNumber != null)
                {
                    hash = hash * 59 + WorkPhoneNumber.GetHashCode();
                }

                if (MobilePhoneNumber != null)
                {
                    hash = hash * 59 + MobilePhoneNumber.GetHashCode();
                }

                if (FaxPhoneNumber != null)
                {
                    hash = hash * 59 + FaxPhoneNumber.GetHashCode();
                }

                if (Address1 != null)
                {
                    hash = hash * 59 + Address1.GetHashCode();
                }

                if (Address2 != null)
                {
                    hash = hash * 59 + Address2.GetHashCode();
                }

                if (City != null)
                {
                    hash = hash * 59 + City.GetHashCode();
                }

                if (Province != null)
                {
                    hash = hash * 59 + Province.GetHashCode();
                }

                if (PostalCode != null)
                {
                    hash = hash * 59 + PostalCode.GetHashCode();
                }

                return(hash);
            }
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            if (FirstName.Length != 0)
            {
                hash ^= FirstName.GetHashCode();
            }
            if (LastName.Length != 0)
            {
                hash ^= LastName.GetHashCode();
            }
            if (HomeAddress1.Length != 0)
            {
                hash ^= HomeAddress1.GetHashCode();
            }
            if (HomeAddress2.Length != 0)
            {
                hash ^= HomeAddress2.GetHashCode();
            }
            if (HomeCity.Length != 0)
            {
                hash ^= HomeCity.GetHashCode();
            }
            if (HomeState.Length != 0)
            {
                hash ^= HomeState.GetHashCode();
            }
            if (HomeZip.Length != 0)
            {
                hash ^= HomeZip.GetHashCode();
            }
            if (HomeNation.Length != 0)
            {
                hash ^= HomeNation.GetHashCode();
            }
            if (HomePhoneNumber.Length != 0)
            {
                hash ^= HomePhoneNumber.GetHashCode();
            }
            if (OfficeAddress1.Length != 0)
            {
                hash ^= OfficeAddress1.GetHashCode();
            }
            if (OfficeAddress2.Length != 0)
            {
                hash ^= OfficeAddress2.GetHashCode();
            }
            if (OfficeCity.Length != 0)
            {
                hash ^= OfficeCity.GetHashCode();
            }
            if (OfficeState.Length != 0)
            {
                hash ^= OfficeState.GetHashCode();
            }
            if (OfficeZip.Length != 0)
            {
                hash ^= OfficeZip.GetHashCode();
            }
            if (OfficeNation.Length != 0)
            {
                hash ^= OfficeNation.GetHashCode();
            }
            if (OfficePhoneNumber.Length != 0)
            {
                hash ^= OfficePhoneNumber.GetHashCode();
            }
            if (MobilePhoneNumber.Length != 0)
            {
                hash ^= MobilePhoneNumber.GetHashCode();
            }
            if (FaxNumber.Length != 0)
            {
                hash ^= FaxNumber.GetHashCode();
            }
            if (EmailAddress.Length != 0)
            {
                hash ^= EmailAddress.GetHashCode();
            }
            if (IsBlacklisted != false)
            {
                hash ^= IsBlacklisted.GetHashCode();
            }
            if (CompanyName.Length != 0)
            {
                hash ^= CompanyName.GetHashCode();
            }
            if (GivenName2.Length != 0)
            {
                hash ^= GivenName2.GetHashCode();
            }
            return(hash);
        }