Exemple #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 (EffectiveFrom != null)
                {
                    hashCode = hashCode * 59 + EffectiveFrom.GetHashCode();
                }
                if (DaysPerWeek != null)
                {
                    hashCode = hashCode * 59 + DaysPerWeek.GetHashCode();
                }
                if (MaxDaysPerWeek != null)
                {
                    hashCode = hashCode * 59 + MaxDaysPerWeek.GetHashCode();
                }
                if (MaxShiftsPerWeek != null)
                {
                    hashCode = hashCode * 59 + MaxShiftsPerWeek.GetHashCode();
                }
                if (MaxConsecutiveDays != null)
                {
                    hashCode = hashCode * 59 + MaxConsecutiveDays.GetHashCode();
                }
                if (MaxConsecutiveDaysRequested != null)
                {
                    hashCode = hashCode * 59 + MaxConsecutiveDaysRequested.GetHashCode();
                }
                if (MaxWorkTimePerDay != null)
                {
                    hashCode = hashCode * 59 + MaxWorkTimePerDay.GetHashCode();
                }
                if (MaxDurationPerShift != null)
                {
                    hashCode = hashCode * 59 + MaxDurationPerShift.GetHashCode();
                }
                if (AdditionalHoursPerWeek != null)
                {
                    hashCode = hashCode * 59 + AdditionalHoursPerWeek.GetHashCode();
                }
                if (MaxOvertimePerDay != null)
                {
                    hashCode = hashCode * 59 + MaxOvertimePerDay.GetHashCode();
                }
                if (MaxOvertimePerWeek != null)
                {
                    hashCode = hashCode * 59 + MaxOvertimePerWeek.GetHashCode();
                }
                if (MaxOvertimePerCalendarMonth != null)
                {
                    hashCode = hashCode * 59 + MaxOvertimePerCalendarMonth.GetHashCode();
                }
                if (WtdDayStart != null)
                {
                    hashCode = hashCode * 59 + WtdDayStart.GetHashCode();
                }
                if (WtdWeekDayStart != null)
                {
                    hashCode = hashCode * 59 + WtdWeekDayStart.GetHashCode();
                }
                if (WtdWeekTimeStart != null)
                {
                    hashCode = hashCode * 59 + WtdWeekTimeStart.GetHashCode();
                }

                hashCode = hashCode * 59 + MinBreakBetweenShifts.GetHashCode();
                if (Notes != null)
                {
                    hashCode = hashCode * 59 + Notes.GetHashCode();
                }
                return(hashCode);
            }
        }