예제 #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 (Name != null)
                {
                    hash = hash * 59 + Name.GetHashCode();
                }

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

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

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

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

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

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

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

                return(hash);
            }
        }