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

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     TeamIds == other.TeamIds ||
                     TeamIds != null &&
                     other.TeamIds != null &&
                     TeamIds.SequenceEqual(other.TeamIds)
                 ) &&
                 (
                     UserIds == other.UserIds ||
                     UserIds != null &&
                     other.UserIds != null &&
                     UserIds.SequenceEqual(other.UserIds)
                 ) &&
                 (
                     DataPolicyIds == other.DataPolicyIds ||
                     DataPolicyIds != null &&
                     other.DataPolicyIds != null &&
                     DataPolicyIds.SequenceEqual(other.DataPolicyIds)
                 ) &&
                 (
                     TermsOfServiceId == other.TermsOfServiceId ||
                     TermsOfServiceId != null &&
                     TermsOfServiceId.Equals(other.TermsOfServiceId)
                 ) &&
                 (
                     SubRealmId == other.SubRealmId ||
                     SubRealmId != null &&
                     SubRealmId.Equals(other.SubRealmId)
                 ));
        }
Example #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 (Uuid != null)
         {
             hashCode = hashCode * 59 + Uuid.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (TeamIds != null)
         {
             hashCode = hashCode * 59 + TeamIds.GetHashCode();
         }
         if (UserIds != null)
         {
             hashCode = hashCode * 59 + UserIds.GetHashCode();
         }
         if (DataPolicyIds != null)
         {
             hashCode = hashCode * 59 + DataPolicyIds.GetHashCode();
         }
         if (TermsOfServiceId != null)
         {
             hashCode = hashCode * 59 + TermsOfServiceId.GetHashCode();
         }
         if (SubRealmId != null)
         {
             hashCode = hashCode * 59 + SubRealmId.GetHashCode();
         }
         return(hashCode);
     }
 }