RoleManager<TRole, TKey> Class

 

Exposes the role related APIs which will automatically save changes to the RoleStore.

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

Inheritance Hierarchy

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

Syntax

public class RoleManager<TRole, TKey> : IDisposable
where TRole : class, IRole<TKey>
where TKey : object, IEquatable<TKey>
generic<typename TRole, typename TKey>
where TRole : ref class, IRole<TKey>
where TKey : Object, IEquatable<TKey>
public ref class RoleManager : IDisposable
type RoleManager<'TRole, 'TKey when 'TRole : not struct and IRole<'TKey> when 'TKey : Object and IEquatable<'TKey>> = 
    class
        interface IDisposable
    end
Public Class RoleManager(Of TRole As { Class, IRole(Of TKey) }, TKey As { Object, IEquatable(Of TKey) })
    Implements IDisposable

Type Parameters

  • TRole
    The type of the role in the manager.
  • TKey
    The type of the keys in the manager.

Constructors

Name Description
System_CAPS_pubmethod RoleManager<TRole, TKey>(IRoleStore<TRole, TKey>)

Initializes a new instance of the RoleManager<TRole, TKey> class.

Properties

Name Description
System_CAPS_pubproperty Roles

Gets the IQueryable of roles if the store is an IQueryableRoleStore.

System_CAPS_pubproperty RoleValidator

Gets or sets the object used to validate roles before persisting changes.

System_CAPS_protproperty Store

Gets or sets the persistence abstraction that the Manager operates against.

Methods

Name Description
System_CAPS_pubmethod CreateAsync(TRole)

Asynchronously creates a role.

System_CAPS_pubmethod DeleteAsync(TRole)

Asynchronously deletes a role.

System_CAPS_pubmethod Dispose()

Releases the resources used by the current instance of the RoleManager<TRole, TKey> class.

System_CAPS_protmethod Dispose(Boolean)

Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the RoleManager<TRole, TKey> class.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod FindByIdAsync(TKey)

Asynchronously finds a role using the specified identifier.

System_CAPS_pubmethod FindByNameAsync(String)

Asynchronously finds a role by name.

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod RoleExistsAsync(String)

Indicates a value whether the role exists.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod UpdateAsync(TRole)

Asynchronously updates an existing role.

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

Microsoft.AspNet.Identity Namespace
ASP.NET Identity

Return to top