示例#1
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
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Laufort == other.Laufort ||
                     Laufort != null &&
                     Laufort.Equals(other.Laufort)
                 ) &&
                 (
                     EMail == other.EMail ||
                     EMail != null &&
                     EMail.Equals(other.EMail)
                 ) &&
                 (
                     Geburtsdatum == other.Geburtsdatum ||
                     Geburtsdatum != null &&
                     Geburtsdatum.Equals(other.Geburtsdatum)
                 ) &&
                 (
                     Laufniveau == other.Laufniveau ||
                     Laufniveau != null &&
                     Laufniveau.Equals(other.Laufniveau)
                 ) &&
                 (
                     Ziel == other.Ziel ||
                     Ziel != null &&
                     Ziel.Equals(other.Ziel)
                 ) &&
                 (
                     Profilbild == other.Profilbild ||
                     Profilbild != null &&
                     Profilbild.Equals(other.Profilbild)
                 ));
        }
示例#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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Laufort != null)
         {
             hashCode = hashCode * 59 + Laufort.GetHashCode();
         }
         if (EMail != null)
         {
             hashCode = hashCode * 59 + EMail.GetHashCode();
         }
         if (Geburtsdatum != null)
         {
             hashCode = hashCode * 59 + Geburtsdatum.GetHashCode();
         }
         if (Laufniveau != null)
         {
             hashCode = hashCode * 59 + Laufniveau.GetHashCode();
         }
         if (Ziel != null)
         {
             hashCode = hashCode * 59 + Ziel.GetHashCode();
         }
         if (Profilbild != null)
         {
             hashCode = hashCode * 59 + Profilbild.GetHashCode();
         }
         return(hashCode);
     }
 }