Example #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 + MinistryServiceAreaID.GetHashCode();

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

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

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

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

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

                return(hash);
            }
        }
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data
 /// structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     return(AreaNumber.GetHashCode() + GroupNumber.GetHashCode() + SerialNumber.GetHashCode());
 }