forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOuterKey.cs
57 lines (45 loc) · 1.1 KB
/
OuterKey.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
using System;
namespace NHibernate.DomainModel
{
/// <summary>
/// Summary description for OuterKey.
/// </summary>
[Serializable]
public class OuterKey
{
private Middle _master;
private string _detailId;
public Middle Master
{
get { return _master; }
set { _master = value; }
}
public string DetailId
{
get { return _detailId; }
set { _detailId = value; }
}
#region System.Object Members
public override bool Equals(object obj)
{
if (this == obj) return true;
OuterKey cidDetailId = obj as OuterKey;
if (cidDetailId == null) return false;
if (_detailId != null ? !_detailId.Equals(cidDetailId.DetailId) : cidDetailId.DetailId != null) return false;
if (_master != null ? !_master.Equals(cidDetailId.Master) : cidDetailId.Master != null) return false;
return true;
}
public override int GetHashCode()
{
unchecked
{
int result;
result = (_master != null ? _master.GetHashCode() : 0);
//TODO: string == null???
result = 29 * result + (_detailId != null ? _detailId.GetHashCode() : 0);
return result;
}
}
#endregion
}
}