Class IdentityUser<TKey, TUserClaim, TUserRole, TUserLogin>
Represents a user in the identity system
public class IdentityUser<TKey, TUserClaim, TUserRole, TUserLogin> : IIdentityUser<TKey>, IConcurrency<TKey> where TKey : IEquatable<TKey>
Type Parameters
TKey
The type used for the primary key for the user.
TUserClaim
The type representing a claim.
TUserRole
The type representing a user role.
TUserLogin
The type representing a user external login.
- Inheritance
-
IdentityUser<TKey, TUserClaim, TUserRole, TUserLogin>
- Implements
-
IIdentityUser<TKey>IConcurrency<TKey>
- Derived
-
IdentityUser<TKey>
Constructors
IdentityUser()
Initializes a new instance of IdentityUser<TKey>.
public IdentityUser()
IdentityUser(string)
Initializes a new instance of IdentityUser<TKey>.
public IdentityUser(string userName)
Parameters
userName
stringThe user name.
Fields
_claims
Claims storage
protected ICollection<TUserClaim> _claims
Field Value
- ICollection<TUserClaim>
_logins
Logins storage
protected ICollection<TUserLogin> _logins
Field Value
- ICollection<TUserLogin>
_roles
Roles storage
protected ICollection<TUserRole> _roles
Field Value
- ICollection<TUserRole>
Properties
AccessFailedCount
Gets or sets the number of failed login attempts for the current user.
public virtual int AccessFailedCount { get; set; }
Property Value
Claims
Navigation property for the claims this user possesses.
[Association(ThisKey = "Id", OtherKey = "UserId", Storage = "_claims")]
public virtual ICollection<TUserClaim> Claims { get; }
Property Value
- ICollection<TUserClaim>
ConcurrencyStamp
A random value that must change whenever a user is persisted to the store
public virtual string ConcurrencyStamp { get; set; }
Property Value
Gets or sets the email address for this user.
public virtual string Email { get; set; }
Property Value
EmailConfirmed
Gets or sets a flag indicating if a user has confirmed their email address.
public virtual bool EmailConfirmed { get; set; }
Property Value
- bool
True if the email address has been confirmed, otherwise false.
Id
Gets or sets the primary key for this user.
[PrimaryKey]
[Column(CanBeNull = false, IsPrimaryKey = true, Length = 255)]
public virtual TKey Id { get; set; }
Property Value
- TKey
LockoutEnabled
Gets or sets a flag indicating if the user could be locked out.
public virtual bool LockoutEnabled { get; set; }
Property Value
- bool
True if the user could be locked out, otherwise false.
LockoutEnd
Gets or sets the date and time, in UTC, when any user lockout ends.
public virtual DateTimeOffset? LockoutEnd { get; set; }
Property Value
Remarks
A value in the past means the user is not locked out.
Logins
Navigation property for this users login accounts.
[Association(ThisKey = "Id", OtherKey = "UserId", Storage = "_logins")]
public virtual ICollection<TUserLogin> Logins { get; }
Property Value
- ICollection<TUserLogin>
NormalizedEmail
Gets or sets the normalized email address for this user.
public virtual string NormalizedEmail { get; set; }
Property Value
NormalizedUserName
Gets or sets the normalized user name for this user.
public virtual string NormalizedUserName { get; set; }
Property Value
PasswordHash
Gets or sets a salted and hashed representation of the password for this user.
public virtual string PasswordHash { get; set; }
Property Value
PhoneNumber
Gets or sets a telephone number for the user.
public virtual string PhoneNumber { get; set; }
Property Value
PhoneNumberConfirmed
Gets or sets a flag indicating if a user has confirmed their telephone address.
public virtual bool PhoneNumberConfirmed { get; set; }
Property Value
- bool
True if the telephone number has been confirmed, otherwise false.
Roles
Navigation property for the roles this user belongs to.
[Association(ThisKey = "Id", OtherKey = "UserId", Storage = "_roles")]
public virtual ICollection<TUserRole> Roles { get; }
Property Value
- ICollection<TUserRole>
SecurityStamp
A random value that must change whenever a users credentials change (password changed, login removed)
public virtual string SecurityStamp { get; set; }
Property Value
TwoFactorEnabled
Gets or sets a flag indicating if two factor authentication is enabled for this user.
public virtual bool TwoFactorEnabled { get; set; }
Property Value
- bool
True if 2fa is enabled, otherwise false.
UserName
Gets or sets the user name for this user.
public virtual string UserName { get; set; }
Property Value
Methods
ToString()
Returns the username for this user.
public override string ToString()