Ejemplo n.º 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 (OwnerEquipmentCodePrefix != null)
                {
                    hash = hash * 59 + OwnerEquipmentCodePrefix.GetHashCode();
                }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                return(hash);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if Owner instances are equal
        /// </summary>
        /// <param name="other">Instance of Owner to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Owner other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     OwnerEquipmentCodePrefix == other.OwnerEquipmentCodePrefix ||
                     OwnerEquipmentCodePrefix != null &&
                     OwnerEquipmentCodePrefix.Equals(other.OwnerEquipmentCodePrefix)
                 ) &&
                 (
                     OrganizationName == other.OrganizationName ||
                     OrganizationName != null &&
                     OrganizationName.Equals(other.OrganizationName)
                 ) &&
                 (
                     MeetsResidency == other.MeetsResidency ||
                     MeetsResidency.Equals(other.MeetsResidency)
                 ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     DoingBusinessAs == other.DoingBusinessAs ||
                     DoingBusinessAs != null &&
                     DoingBusinessAs.Equals(other.DoingBusinessAs)
                 ) &&
                 (
                     RegisteredCompanyNumber == other.RegisteredCompanyNumber ||
                     RegisteredCompanyNumber != null &&
                     RegisteredCompanyNumber.Equals(other.RegisteredCompanyNumber)
                 ) &&
                 (
                     PrimaryContact == other.PrimaryContact ||
                     PrimaryContact != null &&
                     PrimaryContact.Equals(other.PrimaryContact)
                 ) &&
                 (
                     IsMaintenanceContractor == other.IsMaintenanceContractor ||
                     IsMaintenanceContractor != null &&
                     IsMaintenanceContractor.Equals(other.IsMaintenanceContractor)
                 ) &&
                 (
                     WorkSafeBCPolicyNumber == other.WorkSafeBCPolicyNumber ||
                     WorkSafeBCPolicyNumber != null &&
                     WorkSafeBCPolicyNumber.Equals(other.WorkSafeBCPolicyNumber)
                 ) &&
                 (
                     WorkSafeBCExpiryDate == other.WorkSafeBCExpiryDate ||
                     WorkSafeBCExpiryDate != null &&
                     WorkSafeBCExpiryDate.Equals(other.WorkSafeBCExpiryDate)
                 ) &&
                 (
                     CGLEndDate == other.CGLEndDate ||
                     CGLEndDate != null &&
                     CGLEndDate.Equals(other.CGLEndDate)
                 ) &&
                 (
                     ArchiveCode == other.ArchiveCode ||
                     ArchiveCode != null &&
                     ArchiveCode.Equals(other.ArchiveCode)
                 ) &&
                 (
                     ArchiveReason == other.ArchiveReason ||
                     ArchiveReason != null &&
                     ArchiveReason.Equals(other.ArchiveReason)
                 ) &&
                 (
                     ArchiveDate == other.ArchiveDate ||
                     ArchiveDate != null &&
                     ArchiveDate.Equals(other.ArchiveDate)
                 ) &&
                 (
                     Contacts == other.Contacts ||
                     Contacts != null &&
                     Contacts.SequenceEqual(other.Contacts)
                 ) &&
                 (
                     Notes == other.Notes ||
                     Notes != null &&
                     Notes.SequenceEqual(other.Notes)
                 ) &&
                 (
                     Attachments == other.Attachments ||
                     Attachments != null &&
                     Attachments.SequenceEqual(other.Attachments)
                 ) &&
                 (
                     History == other.History ||
                     History != null &&
                     History.SequenceEqual(other.History)
                 ) &&
                 (
                     EquipmentList == other.EquipmentList ||
                     EquipmentList != null &&
                     EquipmentList.SequenceEqual(other.EquipmentList)
                 ));
        }