示例#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 (EquipmentType != null)
                {
                    hash = hash * 59 + EquipmentType.GetHashCode();
                }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                return(hash);
            }
        }