forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserFollower.cs
46 lines (38 loc) · 975 Bytes
/
UserFollower.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
using System;
namespace NHibernate.Test.Extralazy
{
public class UserFollower : IEquatable<UserFollower>
{
public UserFollower(User user, User follower)
{
User = user;
Follower = follower;
}
protected UserFollower()
{
}
public virtual int Id { get; set; }
public virtual User User { get; set; }
public virtual User Follower { get; set; }
public override bool Equals(object obj)
{
if (obj == null) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((UserFollower) obj);
}
public virtual bool Equals(UserFollower other)
{
if (other == null) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(User.Name, other.User.Name) && Equals(Follower.Name, other.Follower.Name);
}
public override int GetHashCode()
{
unchecked
{
return (User.Name.GetHashCode() * 397) ^ Follower.Name.GetHashCode();
}
}
}
}