Exemplo n.º 1
0
 public bool Equals(Contact other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) &&
            EntityRefId.Equals(other.EntityRefId) &&
            Equals(Employer, other.Employer) &&
            ContactTypeId == other.ContactTypeId &&
            PreferredContactMethodType == other.PreferredContactMethodType &&
            IsPrimary == other.IsPrimary &&
            string.Equals(FirstName, other.FirstName) &&
            string.Equals(MiddleName, other.MiddleName) &&
            string.Equals(LastName, other.LastName) &&
            string.Equals(JobTitle, other.JobTitle) &&
            string.Equals(BusinessPhone, other.BusinessPhone) &&
            string.Equals(MobilePhone, other.MobilePhone) &&
            string.Equals(HomePhone, other.HomePhone) &&
            string.Equals(Email, other.Email) &&
            CreatedOn.Equals(other.CreatedOn) &&
            ModifiedOn.Equals(other.ModifiedOn));
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Id.GetHashCode();
                hashCode = (hashCode * 397) ^ EntityRefId.GetHashCode();
                hashCode = (hashCode * 397) ^ (Employer != null ? Employer.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ ContactTypeId;
                hashCode = (hashCode * 397) ^ PreferredContactMethodType;
                hashCode = (hashCode * 397) ^ IsPrimary.GetHashCode();
                hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (MiddleName != null ? MiddleName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (JobTitle != null ? JobTitle.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (BusinessPhone != null ? BusinessPhone.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (MobilePhone != null ? MobilePhone.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (HomePhone != null ? HomePhone.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
                hashCode = (hashCode * 397) ^ ModifiedOn.GetHashCode();

                return(hashCode);
            }
        }