forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMiddleKey.cs
66 lines (53 loc) · 1.28 KB
/
MiddleKey.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
57
58
59
60
61
62
63
64
65
66
using System;
namespace NHibernate.DomainModel
{
/// <summary>
/// Summary description for MiddleKey.
/// </summary>
[Serializable]
public class MiddleKey
{
private Inner _sup;
private string _two;
private string _one;
public Inner Sup
{
get { return _sup; }
set { _sup = value; }
}
public string One
{
get { return _one; }
set { _one = value; }
}
public string Two
{
get { return _two; }
set { _two = value; }
}
#region System.Object Members
public override bool Equals(object obj)
{
if (this == obj) return true;
MiddleKey cidMasterID = obj as MiddleKey;
if (cidMasterID == null) return false;
if (_one != null ? !_one.Equals(cidMasterID.One) : cidMasterID.One != null) return false;
if (_sup != null ? !_sup.Equals(cidMasterID.Sup) : cidMasterID.Sup != null) return false;
if (_two != null ? !_two.Equals(cidMasterID.Two) : cidMasterID.Two != null) return false;
return true;
}
public override int GetHashCode()
{
unchecked
{
int result;
//TODO: string can't be null
result = (_sup != null ? _sup.GetHashCode() : 0);
result = 29 * result + (_one != null ? _one.GetHashCode() : 0);
result = 29 * result + (_two != null ? _two.GetHashCode() : 0);
return result;
}
}
#endregion
}
}