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

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Source == other.Source ||
                     Source != null &&
                     Source.Equals(other.Source)
                 ) &&
                 (
                     Start == other.Start ||
                     Start != null &&
                     Start.Equals(other.Start)
                 ) &&
                 (
                     End == other.End ||
                     End != null &&
                     End.Equals(other.End)
                 ) &&
                 (
                     Classification == other.Classification ||
                     Classification != null &&
                     other.Classification != null &&
                     Classification.SequenceEqual(other.Classification)
                 ) &&
                 (
                     IsCrash == other.IsCrash ||

                     IsCrash.Equals(other.IsCrash)
                 ) &&
                 (
                     IsAutoAssigned == other.IsAutoAssigned ||

                     IsAutoAssigned.Equals(other.IsAutoAssigned)
                 ) &&
                 (
                     Properties == other.Properties ||
                     Properties != null &&
                     other.Properties != null &&
                     Properties.SequenceEqual(other.Properties)
                 ));
        }
예제 #2
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 (Id != null)
                {
                    hashCode = hashCode * 59 + Id.GetHashCode();
                }
                if (Rev != null)
                {
                    hashCode = hashCode * 59 + Rev.GetHashCode();
                }
                if (Type != null)
                {
                    hashCode = hashCode * 59 + Type.GetHashCode();
                }
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }
                if (Source != null)
                {
                    hashCode = hashCode * 59 + Source.GetHashCode();
                }
                if (Start != null)
                {
                    hashCode = hashCode * 59 + Start.GetHashCode();
                }
                if (End != null)
                {
                    hashCode = hashCode * 59 + End.GetHashCode();
                }
                if (Classification != null)
                {
                    hashCode = hashCode * 59 + Classification.GetHashCode();
                }

                hashCode = hashCode * 59 + IsCrash.GetHashCode();

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