コード例 #1
0
ファイル: User.cs プロジェクト: pawluk/MOSHApp-WS
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (Nickname != null ? Nickname.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StudentNumber != null ? StudentNumber.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #2
0
        public override int GetHashCode()
        {
            int result = 1;

            result = (result * 397) ^ CurrentYear.GetHashCode();
            result = (result * 397) ^ Id.GetHashCode();
            result = (result * 397) ^ (RegistrationNumber != null ? RegistrationNumber.GetHashCode() : 0);
            result = (result * 397) ^ (Remark != null ? Remark.GetHashCode() : 0);
            result = (result * 397) ^ StudentStatus.GetHashCode();
            result = (result * 397) ^ (StudentNumber != null ? StudentNumber.GetHashCode() : 0);
            result = (result * 397) ^ CurrentCGPA.GetHashCode();
            result = (result * 397) ^ CurrentCTCU.GetHashCode();
            result = (result * 397) ^ CurrentAward.GetHashCode();
            return(result);
        }