Exemple #1
0
        /// <summary>
        /// Returns true if ConditionType instances are equal
        /// </summary>
        /// <param name="other">Instance of ConditionType to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ConditionType other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     District == other.District ||
                     District.Equals(other.District)
                 ) &&
                 (
                     ConditionTypeCode == other.ConditionTypeCode ||
                     ConditionTypeCode.Equals(other.ConditionTypeCode)
                 ) &&
                 (
                     Description == other.Description ||
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Active == other.Active ||
                     Active.Equals(other.Active)
                 ));
        }
Exemple #2
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 (District != null)
                {
                    hash = hash * 59 + District.GetHashCode();
                }

                hash = hash * 59 + ConditionTypeCode.GetHashCode();
                hash = hash * 59 + Description.GetHashCode();
                hash = hash * 59 + Active.GetHashCode();

                return(hash);
            }
        }