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

            return
                ((
                     UserId == other.UserId ||
                     UserId != null &&
                     UserId.Equals(other.UserId)
                     ) &&
                 (
                     RestorationId == other.RestorationId ||
                     RestorationId != null &&
                     RestorationId.Equals(other.RestorationId)
                 ) &&
                 (
                     Password == other.Password ||
                     Password != null &&
                     Password.Equals(other.Password)
                 ));
        }
Exemplo n.º 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 (UserId != null)
         {
             hashCode = hashCode * 59 + UserId.GetHashCode();
         }
         if (RestorationId != null)
         {
             hashCode = hashCode * 59 + RestorationId.GetHashCode();
         }
         if (Password != null)
         {
             hashCode = hashCode * 59 + Password.GetHashCode();
         }
         return(hashCode);
     }
 }