forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.cs
67 lines (55 loc) · 1.59 KB
/
User.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
67
using System.Collections.Generic;
namespace NHibernate.Test.Extralazy
{
public class User
{
private string name;
private string password;
private IDictionary<string, SessionAttribute> session = new Dictionary<string, SessionAttribute>();
private ISet<Document> documents = new HashSet<Document>();
private ISet<Photo> photos = new HashSet<Photo>();
protected User() {}
public User(string name, string password)
{
this.name = name;
this.password = password;
}
public virtual string Name
{
get { return name; }
set { name = value; }
}
public virtual string Password
{
get { return password; }
set { password = value; }
}
public virtual IDictionary<string, SessionAttribute> Session
{
get { return session; }
set { session = value; }
}
public virtual ISet<Document> Documents
{
get { return documents; }
set { documents = value; }
}
public virtual ISet<Photo> Photos
{
get { return photos; }
set { photos = value; }
}
public virtual IDictionary<string, UserSetting> Settings { get; set; } = new Dictionary<string, UserSetting>();
public virtual ISet<UserPermission> Permissions { get; set; } = new HashSet<UserPermission>();
public virtual ISet<UserFollower> Followers { get; set; } = new HashSet<UserFollower>();
public virtual IList<Company> Companies { get; set; } = new List<Company>();
public virtual IList<CreditCard> CreditCards { get; set; } = new List<CreditCard>();
public virtual void UpdateCompaniesIndexes()
{
for (var i = 0; i < Companies.Count; i++)
{
Companies[i].ListIndex = i;
}
}
}
}