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

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Tenantid == other.Tenantid ||
                     Tenantid != null &&
                     Tenantid.Equals(other.Tenantid)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Lastname == other.Lastname ||
                     Lastname != null &&
                     Lastname.Equals(other.Lastname)
                 ) &&
                 (
                     Thirdname == other.Thirdname ||
                     Thirdname != null &&
                     Thirdname.Equals(other.Thirdname)
                 ) &&
                 (
                     Login == other.Login ||
                     Login != null &&
                     Login.Equals(other.Login)
                 ) &&
                 (
                     Passord == other.Passord ||
                     Passord != null &&
                     Passord.Equals(other.Passord)
                 ));
        }
예제 #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 (Tenantid != null)
         {
             hashCode = hashCode * 59 + Tenantid.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Lastname != null)
         {
             hashCode = hashCode * 59 + Lastname.GetHashCode();
         }
         if (Thirdname != null)
         {
             hashCode = hashCode * 59 + Thirdname.GetHashCode();
         }
         if (Login != null)
         {
             hashCode = hashCode * 59 + Login.GetHashCode();
         }
         if (Passord != null)
         {
             hashCode = hashCode * 59 + Passord.GetHashCode();
         }
         return(hashCode);
     }
 }