-
Notifications
You must be signed in to change notification settings - Fork 92
/
IdentityUser.cs
109 lines (98 loc) · 3.07 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
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace MongoDB.AspNet.Identity
{
/// <summary>
/// Class IdentityUser.
/// </summary>
public class IdentityUser : IUser<string>
{
/// <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 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>
/// Gets the phone number
/// </summary>
public virtual string PhoneNumber { get; set; }
/// <summary>
/// Gets Email address
/// </summary>
public virtual string Email { get; set; }
/// <summary>
///
/// </summary>
public virtual bool EmailConfirmed { get; set; }
/// <summary>
///
/// </summary>
public DateTime? LockoutEndDateUtc { get; set; } = DateTime.Now.ToUniversalTime();
/// <summary>
///
/// </summary>
public int AccessFailedCount { get; set; }
/// <summary>
///
/// </summary>
public bool LockoutEnabled { get; set; }
/// <summary>
///
/// </summary>
public bool TwoFactorEnabled { get; 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;
}
}
}