RoleManager<TRole> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides the APIs for managing roles in a persistence store.
generic <typename TRole>
where TRole : classpublic ref class RoleManager : IDisposable
public class RoleManager<TRole> : IDisposable where TRole : class
type RoleManager<'Role (requires 'Role : null)> = class
interface IDisposable
Public Class RoleManager(Of TRole)
Implements IDisposable
Type Parameters
- TRole
The type encapsulating a role.
- Inheritance
-
RoleManager<TRole>
- Derived
- Implements
Constructors
Properties
CancellationToken |
The cancellation token used to cancel operations. |
ErrorDescriber |
Gets the IdentityErrorDescriber used to provider error messages. |
KeyNormalizer |
Gets the normalizer to use when normalizing role names to keys. |
Logger |
Gets the ILogger used to log messages from the manager. |
Roles |
Gets an IQueryable collection of Roles if the persistence store is an IQueryableRoleStore<TRole>, otherwise throws a NotSupportedException. |
RoleValidators |
Gets a list of validators for roles to call before persistence. |
Store |
Gets the persistence store this instance operates over. |
SupportsQueryableRoles |
Gets a flag indicating whether the underlying persistence store supports returning an IQueryable collection of roles. |
SupportsRoleClaims |
Gets a flag indicating whether the underlying persistence store supports Claims for roles. |
Methods
AddClaimAsync(TRole, Claim) |
Adds a claim to a role. |
CreateAsync(TRole) |
Creates the specified |
DeleteAsync(TRole) |
Deletes the specified |
Dispose() |
Releases all resources used by the role manager. |
Dispose(Boolean) |
Releases the unmanaged resources used by the role manager and optionally releases the managed resources. |
FindByIdAsync(String) |
Finds the role associated with the specified |
FindByNameAsync(String) |
Finds the role associated with the specified |
GetClaimsAsync(TRole) |
Gets a list of claims associated with the specified |
GetRoleIdAsync(TRole) |
Gets the ID of the specified |
GetRoleNameAsync(TRole) |
Gets the name of the specified |
NormalizeKey(String) |
Gets a normalized representation of the specified |
RemoveClaimAsync(TRole, Claim) |
Removes a claim from a role. |
RoleExistsAsync(String) |
Gets a flag indicating whether the specified |
SetRoleNameAsync(TRole, String) |
Sets the name of the specified |
ThrowIfDisposed() |
Throws if this class has been disposed. |
UpdateAsync(TRole) |
Updates the specified |
UpdateNormalizedRoleNameAsync(TRole) |
Updates the normalized name for the specified |
UpdateRoleAsync(TRole) |
Called to update the role after validating and updating the normalized role name. |
ValidateRoleAsync(TRole) |
Should return Success if validation is successful. This is called before saving the role via Create or Update. |