Пример #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();
                hash = hash * 59 + StartDate.GetHashCode();
                hash = hash * 59 + EndDate.GetHashCode();

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

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

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

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

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

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

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

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

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

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

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

                return(hash);
            }
        }
Пример #2
0
        /// <summary>
        /// Returns true if SeniorityAudit instances are equal
        /// </summary>
        /// <param name="other">Instance of SeniorityAudit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SeniorityAudit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     StartDate == other.StartDate ||
                     StartDate.Equals(other.StartDate)
                 ) &&
                 (
                     EndDate == other.EndDate ||
                     EndDate.Equals(other.EndDate)
                 ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     Equipment == other.Equipment ||
                     Equipment != null &&
                     Equipment.Equals(other.Equipment)
                 ) &&
                 (
                     BlockNumber == other.BlockNumber ||
                     BlockNumber != null &&
                     BlockNumber.Equals(other.BlockNumber)
                 ) &&
                 (
                     Owner == other.Owner ||
                     Owner != null &&
                     Owner.Equals(other.Owner)
                 ) &&
                 (
                     OwnerOrganizationName == other.OwnerOrganizationName ||
                     OwnerOrganizationName != null &&
                     OwnerOrganizationName.Equals(other.OwnerOrganizationName)
                 ) &&
                 (
                     Seniority == other.Seniority ||
                     Seniority != null &&
                     Seniority.Equals(other.Seniority)
                 ) &&
                 (
                     ServiceHoursLastYear == other.ServiceHoursLastYear ||
                     ServiceHoursLastYear != null &&
                     ServiceHoursLastYear.Equals(other.ServiceHoursLastYear)
                 ) &&
                 (
                     ServiceHoursTwoYearsAgo == other.ServiceHoursTwoYearsAgo ||
                     ServiceHoursTwoYearsAgo != null &&
                     ServiceHoursTwoYearsAgo.Equals(other.ServiceHoursTwoYearsAgo)
                 ) &&
                 (
                     ServiceHoursThreeYearsAgo == other.ServiceHoursThreeYearsAgo ||
                     ServiceHoursThreeYearsAgo != null &&
                     ServiceHoursThreeYearsAgo.Equals(other.ServiceHoursThreeYearsAgo)
                 ) &&
                 (
                     IsSeniorityOverridden == other.IsSeniorityOverridden ||
                     IsSeniorityOverridden != null &&
                     IsSeniorityOverridden.Equals(other.IsSeniorityOverridden)
                 ) &&
                 (
                     SeniorityOverrideReason == other.SeniorityOverrideReason ||
                     SeniorityOverrideReason != null &&
                     SeniorityOverrideReason.Equals(other.SeniorityOverrideReason)
                 ));
        }