コード例 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (UserId != 0)
            {
                hash ^= UserId.GetHashCode();
            }
            if (UserName.Length != 0)
            {
                hash ^= UserName.GetHashCode();
            }
            if (UserHead != 0)
            {
                hash ^= UserHead.GetHashCode();
            }
            if (LastLoginTime != 0L)
            {
                hash ^= LastLoginTime.GetHashCode();
            }
            if (CardNum != 0)
            {
                hash ^= CardNum.GetHashCode();
            }
            if (DepartmentLevel != 0)
            {
                hash ^= DepartmentLevel.GetHashCode();
            }
            return(hash);
        }
コード例 #2
0
 protected override int GetHashCodeCore()
 {
     unchecked
     {
         int hashCode = IP.GetHashCode();
         hashCode = (hashCode * 397) ^ CardNum.GetHashCode();
         return(hashCode);
     }
 }