forked from JenTechSystems/MongoDB.AspNet.Identity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdentityUser.cs
130 lines (122 loc) · 4.21 KB
/
IdentityUser.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
using System;
using System.Collections.Generic;
using Microsoft.AspNet.Identity;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace MongoDB.AspNet.Identity
{
/// <summary>
/// Class IdentityUser.
/// </summary>
public class IdentityUser : IUser
{
/// <summary>
/// Unique key for the user
/// </summary>
/// <value>The identifier.</value>
/// <returns>The unique key for the user</returns>
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public virtual string Id { get; set; }
/// <summary>
/// Gets or sets the name of the user.
/// </summary>
/// <value>The name of the user.</value>
public virtual string UserName { get; set; }
/// <summary>
/// Gets or sets the email of the user.
/// </summary>
/// <value>The email of the user.</value>
public virtual string Email { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [email confirmed].
/// </summary>
/// <value><c>true</c> if [email confirmed]; otherwise, <c>false</c>.</value>
public virtual bool EmailConfirmed { get; set; }
/// <summary>
/// Gets or sets the access failed count.
/// </summary>
/// <value>The access failed count.</value>
public virtual int AccessFailedCount { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [lockout enabled].
/// </summary>
/// <value><c>true</c> if [lockout enabled]; otherwise, <c>false</c>.</value>
public virtual bool LockoutEnabled { get; set; }
/// <summary>
/// Gets or sets the lockout end date UTC.
/// </summary>
/// <value>The lockout end date UTC.</value>
public virtual DateTime? LockoutEndDateUtc { get; set; }
/// <summary>
/// Gets or sets the password hash.
/// </summary>
/// <value>The password hash.</value>
public virtual string PasswordHash { get; set; }
/// <summary>
/// Gets or sets the security stamp.
/// </summary>
/// <value>The security stamp.</value>
public virtual string SecurityStamp { get; set; }
/// <summary>
/// Gets the roles.
/// </summary>
/// <value>The roles.</value>
public virtual List<string> Roles { get; private set; }
/// <summary>
/// Gets the claims.
/// </summary>
/// <value>The claims.</value>
public virtual List<IdentityUserClaim> Claims { get; private set; }
/// <summary>
/// Gets the logins.
/// </summary>
/// <value>The logins.</value>
public virtual List<UserLoginInfo> Logins { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="IdentityUser"/> class.
/// </summary>
public IdentityUser()
{
this.Claims = new List<IdentityUserClaim>();
this.Roles = new List<string>();
this.Logins = new List<UserLoginInfo>();
}
/// <summary>
/// Initializes a new instance of the <see cref="IdentityUser"/> class.
/// </summary>
/// <param name="userName">Name of the user.</param>
public IdentityUser(string userName) : this()
{
this.UserName = userName;
}
}
/// <summary>
/// Class IdentityUserClaim.
/// </summary>
public class IdentityUserClaim
{
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public virtual string Id { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public virtual string UserId { get; set; }
/// <summary>
/// Gets or sets the type of the claim.
/// </summary>
/// <value>The type of the claim.</value>
public virtual string ClaimType { get; set; }
/// <summary>
/// Gets or sets the claim value.
/// </summary>
/// <value>The claim value.</value>
public virtual string ClaimValue { get; set; }
}
}