Class IdentityRole<TKey, TUserRole, TRoleClaim>
Represents a role in the identity system
public class IdentityRole<TKey, TUserRole, TRoleClaim> : IIdentityRole<TKey>, IConcurrency<TKey> where TKey : IEquatable<TKey> where TUserRole : IdentityUserRole<TKey> where TRoleClaim : IdentityRoleClaim<TKey>
Type Parameters
TKey
The type used for the primary key for the role.
TUserRole
The type used for user roles.
TRoleClaim
The type used for role claims.
- Inheritance
-
IdentityRole<TKey, TUserRole, TRoleClaim>
- Implements
-
IIdentityRole<TKey>IConcurrency<TKey>
- Derived
-
IdentityRole<TKey>
Constructors
IdentityRole()
Initializes a new instance of IdentityRole<TKey>.
public IdentityRole()
IdentityRole(string)
Initializes a new instance of IdentityRole<TKey>.
public IdentityRole(string roleName)
Parameters
roleName
stringThe role name.
Fields
_claims
Claims storage
protected ICollection<TRoleClaim> _claims
Field Value
- ICollection<TRoleClaim>
_users
Users storage
protected ICollection<TUserRole> _users
Field Value
- ICollection<TUserRole>
Properties
Claims
Navigation property for claims in this role.
[Association(ThisKey = "Id", OtherKey = "RoleId", Storage = "_claims")]
public virtual ICollection<TRoleClaim> Claims { get; }
Property Value
- ICollection<TRoleClaim>
ConcurrencyStamp
A random value that should change whenever a role is persisted to the store
public virtual string ConcurrencyStamp { get; set; }
Property Value
Id
Gets or sets the primary key for this role.
[PrimaryKey]
[Column(CanBeNull = false, IsPrimaryKey = true, Length = 255)]
public virtual TKey Id { get; set; }
Property Value
- TKey
Name
Gets or sets the name for this role.
public virtual string Name { get; set; }
Property Value
NormalizedName
Gets or sets the normalized name for this role.
public virtual string NormalizedName { get; set; }
Property Value
Users
Navigation property for the users in this role.
[Association(ThisKey = "Id", OtherKey = "RoleId", Storage = "_users")]
public virtual ICollection<TUserRole> Users { get; }
Property Value
- ICollection<TUserRole>
Methods
ToString()
Returns the name of the role.
public override string ToString()
Returns
- string
The name of the role.