RoleManager<TRole> Class

Exposes role related api which will automatically save changes to the RoleStore

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.RoleManager<TRole>

Namespace:  Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

'Declaration
Public Class RoleManager(Of TRole As IRole) _
    Implements IDisposable
'Usage
Dim instance As RoleManager(Of TRole)
public class RoleManager<TRole> : IDisposable 
where TRole : IRole
generic<typename TRole>
where TRole : IRole 
public ref class RoleManager : IDisposable
type RoleManager<'TRole when 'TRole : IRole> =  
    class 
        interface IDisposable 
    end
JScript does not support generic types and methods.

Type Parameters

  • TRole

The RoleManager<TRole> type exposes the following members.

Constructors

  Name Description
Public method RoleManager<TRole> Constructor

Top

Properties

  Name Description
Public property RoleValidator Used to validate roles before persisting changes
Protected property Store Persistence abstraction that the Manager operates against

Top

Methods

  Name Description
Public method CreateAsync Create a role
Public method Dispose() Dispose the store context
Protected method Dispose(Boolean) When disposing, actually dipose the store context
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method FindByIdAsync Find a role by id
Public method FindByNameAsync Find a role by name
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method RoleExistsAsync Returns true if the role exists
Public method ToString (Inherited from Object.)
Public method UpdateAsync Update an existing role

Top

Extension Methods

  Name Description
Public Extension Method Create<TRole> Create a role (Defined by RoleManagerExtensions.)
Public Extension Method FindById<TRole> Find a role by id (Defined by RoleManagerExtensions.)
Public Extension Method FindByName<TRole> Find a role by name (Defined by RoleManagerExtensions.)
Public Extension Method RoleExists<TRole> Returns true if the role exists (Defined by RoleManagerExtensions.)
Public Extension Method Update<TRole> Update an existing role (Defined by RoleManagerExtensions.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.AspNet.Identity Namespace