forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInnerKey.cs
56 lines (45 loc) · 1.04 KB
/
InnerKey.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
namespace NHibernate.DomainModel
{
/// <summary>
/// Summary description for InnerKey.
/// </summary>
[Serializable]
public class InnerKey
{
private string _aKey;
private string _bKey;
public string AKey
{
get { return _aKey; }
set { _aKey = value; }
}
public string BKey
{
get { return _bKey; }
set { _bKey = value; }
}
#region object Members
public override bool Equals(object obj)
{
if (this == obj) return true;
InnerKey cidSuperID = obj as InnerKey;
if (cidSuperID == null) return false;
if (_aKey != null ? !_aKey.Equals(cidSuperID._aKey) : cidSuperID._aKey != null) return false;
if (_bKey != null ? !_bKey.Equals(cidSuperID._bKey) : cidSuperID._bKey != null) return false;
return true;
}
public override int GetHashCode()
{
unchecked
{
int result;
//TODO: string won't be null - verify
result = (_aKey != null ? _aKey.GetHashCode() : 0);
result = 29 * result + (_bKey != null ? _bKey.GetHashCode() : 0);
return result;
}
}
#endregion
}
}