|
1 |
| -using System; |
2 |
| -using System.Collections.Generic; |
3 |
| -using System.Linq; |
4 |
| -using System.Text; |
5 |
| -using System.Threading.Tasks; |
| 1 | +using System.Collections.Generic; |
6 | 2 | using Microsoft.AspNet.Identity;
|
7 | 3 | using MongoDB.Bson;
|
8 | 4 | using MongoDB.Bson.Serialization.Attributes;
|
9 | 5 |
|
| 6 | + |
10 | 7 | namespace MongoDB.AspNet.Identity
|
11 | 8 | {
|
| 9 | + /// <summary> |
| 10 | + /// Class IdentityUser. |
| 11 | + /// </summary> |
12 | 12 | public class IdentityUser : IUser
|
13 | 13 | {
|
| 14 | + /// <summary> |
| 15 | + /// Unique key for the user |
| 16 | + /// </summary> |
| 17 | + /// <value>The identifier.</value> |
| 18 | + /// <returns>The unique key for the user</returns> |
14 | 19 | [BsonId]
|
15 | 20 | [BsonRepresentation(BsonType.ObjectId)]
|
16 | 21 | public virtual string Id { get; set; }
|
| 22 | + /// <summary> |
| 23 | + /// Gets or sets the name of the user. |
| 24 | + /// </summary> |
| 25 | + /// <value>The name of the user.</value> |
17 | 26 | public virtual string UserName { get; set; }
|
| 27 | + /// <summary> |
| 28 | + /// Gets or sets the password hash. |
| 29 | + /// </summary> |
| 30 | + /// <value>The password hash.</value> |
18 | 31 | public virtual string PasswordHash { get; set; }
|
| 32 | + /// <summary> |
| 33 | + /// Gets or sets the security stamp. |
| 34 | + /// </summary> |
| 35 | + /// <value>The security stamp.</value> |
19 | 36 | public virtual string SecurityStamp { get; set; }
|
| 37 | + /// <summary> |
| 38 | + /// Gets the roles. |
| 39 | + /// </summary> |
| 40 | + /// <value>The roles.</value> |
20 | 41 | public virtual List<string> Roles { get; private set; }
|
| 42 | + /// <summary> |
| 43 | + /// Gets the claims. |
| 44 | + /// </summary> |
| 45 | + /// <value>The claims.</value> |
21 | 46 | public virtual List<IdentityUserClaim> Claims { get; private set; }
|
| 47 | + /// <summary> |
| 48 | + /// Gets the logins. |
| 49 | + /// </summary> |
| 50 | + /// <value>The logins.</value> |
22 | 51 | public virtual List<UserLoginInfo> Logins { get; private set; }
|
23 | 52 |
|
| 53 | + /// <summary> |
| 54 | + /// Initializes a new instance of the <see cref="IdentityUser"/> class. |
| 55 | + /// </summary> |
24 | 56 | public IdentityUser()
|
25 | 57 | {
|
26 | 58 | this.Claims = new List<IdentityUserClaim>();
|
27 | 59 | this.Roles = new List<string>();
|
28 | 60 | this.Logins = new List<UserLoginInfo>();
|
29 | 61 | }
|
30 | 62 |
|
31 |
| - public IdentityUser(string userName) |
32 |
| - : this() |
| 63 | + /// <summary> |
| 64 | + /// Initializes a new instance of the <see cref="IdentityUser"/> class. |
| 65 | + /// </summary> |
| 66 | + /// <param name="userName">Name of the user.</param> |
| 67 | + public IdentityUser(string userName) : this() |
33 | 68 | {
|
34 | 69 | this.UserName = userName;
|
35 | 70 | }
|
36 | 71 | }
|
37 | 72 |
|
38 |
| - //public sealed class IdentityUserLogin |
39 |
| - //{ |
40 |
| - // [BsonId] |
41 |
| - // [BsonRepresentation(BsonType.ObjectId)] |
42 |
| - // public string UserId { get; set; } |
43 |
| - // public string LoginProvider { get; set; } |
44 |
| - // public string ProviderKey { get; set; } |
45 |
| - //} |
46 |
| - |
| 73 | + /// <summary> |
| 74 | + /// Class IdentityUserClaim. |
| 75 | + /// </summary> |
47 | 76 | public class IdentityUserClaim
|
48 | 77 | {
|
| 78 | + /// <summary> |
| 79 | + /// Gets or sets the identifier. |
| 80 | + /// </summary> |
| 81 | + /// <value>The identifier.</value> |
49 | 82 | [BsonId]
|
50 | 83 | [BsonRepresentation(BsonType.ObjectId)]
|
51 |
| - public virtual string Id { get; set; } |
| 84 | + public virtual string Id { get; set; } |
| 85 | + /// <summary> |
| 86 | + /// Gets or sets the user identifier. |
| 87 | + /// </summary> |
| 88 | + /// <value>The user identifier.</value> |
52 | 89 | public virtual string UserId { get; set; }
|
| 90 | + /// <summary> |
| 91 | + /// Gets or sets the type of the claim. |
| 92 | + /// </summary> |
| 93 | + /// <value>The type of the claim.</value> |
53 | 94 | public virtual string ClaimType { get; set; }
|
| 95 | + /// <summary> |
| 96 | + /// Gets or sets the claim value. |
| 97 | + /// </summary> |
| 98 | + /// <value>The claim value.</value> |
54 | 99 | public virtual string ClaimValue { get; set; }
|
55 | 100 |
|
56 | 101 | }
|
|
0 commit comments