forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKey.cs
31 lines (28 loc) · 840 Bytes
/
Key.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
namespace NHibernate.Test.ProjectionFixtures
{
public class Key
{
public virtual int Id { get; set; }
public virtual int Area { get; set; }
public virtual bool Equals(Key obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
return obj.Id == Id && obj.Area == Area;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != typeof (Key)) return false;
return Equals((Key) obj);
}
public override int GetHashCode()
{
unchecked
{
return (Id*397) ^ Area;
}
}
}
}