示例#1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (StaffGroup != null)
                {
                    hashCode = hashCode * 59 + StaffGroup.GetHashCode();
                }
                if (Grade != null)
                {
                    hashCode = hashCode * 59 + Grade.GetHashCode();
                }
                if (_Contract != null)
                {
                    hashCode = hashCode * 59 + _Contract.GetHashCode();
                }
                if (Payscale != null)
                {
                    hashCode = hashCode * 59 + Payscale.GetHashCode();
                }
                if (ContractType != null)
                {
                    hashCode = hashCode * 59 + ContractType.GetHashCode();
                }
                if (ContractedTime != null)
                {
                    hashCode = hashCode * 59 + ContractedTime.GetHashCode();
                }
                if (DefaultUnavailabilityHours != null)
                {
                    hashCode = hashCode * 59 + DefaultUnavailabilityHours.GetHashCode();
                }

                hashCode = hashCode * 59 + WtdOptOut.GetHashCode();
                if (SalaryFrequency != null)
                {
                    hashCode = hashCode * 59 + SalaryFrequency.GetHashCode();
                }

                hashCode = hashCode * 59 + SalaryAmount.GetHashCode();
                return(hashCode);
            }
        }
示例#2
0
        /// <summary>
        /// Returns true if Contract instances are equal
        /// </summary>
        /// <param name="other">Instance of Contract to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Contract other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     StaffGroup == other.StaffGroup ||
                     StaffGroup != null &&
                     StaffGroup.Equals(other.StaffGroup)
                     ) &&
                 (
                     Grade == other.Grade ||
                     Grade != null &&
                     Grade.Equals(other.Grade)
                 ) &&
                 (
                     _Contract == other._Contract ||
                     _Contract != null &&
                     _Contract.Equals(other._Contract)
                 ) &&
                 (
                     Payscale == other.Payscale ||
                     Payscale != null &&
                     Payscale.Equals(other.Payscale)
                 ) &&
                 (
                     ContractType == other.ContractType ||
                     ContractType != null &&
                     ContractType.Equals(other.ContractType)
                 ) &&
                 (
                     ContractedTime == other.ContractedTime ||
                     ContractedTime != null &&
                     ContractedTime.Equals(other.ContractedTime)
                 ) &&
                 (
                     DefaultUnavailabilityHours == other.DefaultUnavailabilityHours ||
                     DefaultUnavailabilityHours != null &&
                     DefaultUnavailabilityHours.Equals(other.DefaultUnavailabilityHours)
                 ) &&
                 (
                     WtdOptOut == other.WtdOptOut ||

                     WtdOptOut.Equals(other.WtdOptOut)
                 ) &&
                 (
                     SalaryFrequency == other.SalaryFrequency ||
                     SalaryFrequency != null &&
                     SalaryFrequency.Equals(other.SalaryFrequency)
                 ) &&
                 (
                     SalaryAmount == other.SalaryAmount ||

                     SalaryAmount.Equals(other.SalaryAmount)
                 ));
        }