示例#1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Enabled != null)
         {
             hashCode = hashCode * 59 + Enabled.GetHashCode();
         }
         if (Groups != null)
         {
             hashCode = hashCode * 59 + Groups.GetHashCode();
         }
         if (GroupsArray != null)
         {
             hashCode = hashCode * 59 + GroupsArray.GetHashCode();
         }
         if (Aggregations != null)
         {
             hashCode = hashCode * 59 + Aggregations.GetHashCode();
         }
         if (GroupsSrc != null)
         {
             hashCode = hashCode * 59 + GroupsSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#2
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Aggregate other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Enabled == other.Enabled ||
                     Enabled != null &&
                     Enabled.Equals(other.Enabled)
                 ) &&
                 (
                     Groups == other.Groups ||
                     Groups != null &&
                     Groups.Equals(other.Groups)
                 ) &&
                 (
                     Equals(GroupsArray, other.GroupsArray) ||
                     GroupsArray != null && other.GroupsArray != null &&
                     GroupsArray.SequenceEqual(other.GroupsArray)
                 ) &&
                 (
                     Equals(Aggregations, other.Aggregations) ||
                     Aggregations != null && other.Aggregations != null &&
                     Aggregations.SequenceEqual(other.Aggregations)
                 ) &&
                 (
                     GroupsSrc == other.GroupsSrc ||
                     GroupsSrc != null &&
                     GroupsSrc.Equals(other.GroupsSrc)
                 ));
        }