Exemplo n.º 1
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 (Surname != null)
         {
             hashCode = hashCode * 59 + Surname.GetHashCode();
         }
         if (Username != null)
         {
             hashCode = hashCode * 59 + Username.GetHashCode();
         }
         if (Password != null)
         {
             hashCode = hashCode * 59 + Password.GetHashCode();
         }
         if (Email != null)
         {
             hashCode = hashCode * 59 + Email.GetHashCode();
         }
         if (PhoneNumber != null)
         {
             hashCode = hashCode * 59 + PhoneNumber.GetHashCode();
         }
         if (Avatar != null)
         {
             hashCode = hashCode * 59 + Avatar.GetHashCode();
         }
         if (LdapAuthenticationModeId != null)
         {
             hashCode = hashCode * 59 + LdapAuthenticationModeId.GetHashCode();
         }
         if (RoleIds != null)
         {
             hashCode = hashCode * 59 + RoleIds.GetHashCode();
         }
         if (TeamIds != null)
         {
             hashCode = hashCode * 59 + TeamIds.GetHashCode();
         }
         if (CustomAttributes != null)
         {
             hashCode = hashCode * 59 + CustomAttributes.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if UserSubmit instances are equal
        /// </summary>
        /// <param name="other">Instance of UserSubmit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserSubmit 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)
                 ) &&
                 (
                     Surname == other.Surname ||
                     Surname != null &&
                     Surname.Equals(other.Surname)
                 ) &&
                 (
                     Username == other.Username ||
                     Username != null &&
                     Username.Equals(other.Username)
                 ) &&
                 (
                     Password == other.Password ||
                     Password != null &&
                     Password.Equals(other.Password)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     PhoneNumber == other.PhoneNumber ||
                     PhoneNumber != null &&
                     PhoneNumber.Equals(other.PhoneNumber)
                 ) &&
                 (
                     Avatar == other.Avatar ||
                     Avatar != null &&
                     Avatar.Equals(other.Avatar)
                 ) &&
                 (
                     LdapAuthenticationModeId == other.LdapAuthenticationModeId ||
                     LdapAuthenticationModeId != null &&
                     LdapAuthenticationModeId.Equals(other.LdapAuthenticationModeId)
                 ) &&
                 (
                     RoleIds == other.RoleIds ||
                     RoleIds != null &&
                     other.RoleIds != null &&
                     RoleIds.SequenceEqual(other.RoleIds)
                 ) &&
                 (
                     TeamIds == other.TeamIds ||
                     TeamIds != null &&
                     other.TeamIds != null &&
                     TeamIds.SequenceEqual(other.TeamIds)
                 ));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true if User instances are equal
        /// </summary>
        /// <param name="other">Instance of User to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(User 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)
                 ) &&
                 (
                     Surname == other.Surname ||
                     Surname != null &&
                     Surname.Equals(other.Surname)
                 ) &&
                 (
                     Username == other.Username ||
                     Username != null &&
                     Username.Equals(other.Username)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     PhoneNumber == other.PhoneNumber ||
                     PhoneNumber != null &&
                     PhoneNumber.Equals(other.PhoneNumber)
                 ) &&
                 (
                     Avatar == other.Avatar ||
                     Avatar != null &&
                     Avatar.Equals(other.Avatar)
                 ) &&
                 (
                     IsDeleted == other.IsDeleted ||

                     IsDeleted.Equals(other.IsDeleted)
                 ) &&
                 (
                     LdapAuthenticationModeId == other.LdapAuthenticationModeId ||
                     LdapAuthenticationModeId != null &&
                     LdapAuthenticationModeId.Equals(other.LdapAuthenticationModeId)
                 ) &&
                 (
                     Roles == other.Roles ||
                     Roles != null &&
                     other.Roles != null &&
                     Roles.SequenceEqual(other.Roles)
                 ) &&
                 (
                     Teams == other.Teams ||
                     Teams != null &&
                     other.Teams != null &&
                     Teams.SequenceEqual(other.Teams)
                 ) &&
                 (
                     CustomAttributes == other.CustomAttributes ||
                     CustomAttributes != null &&
                     other.CustomAttributes != null &&
                     CustomAttributes.SequenceEqual(other.CustomAttributes)
                 ));
        }