Share via


RoleStore<TRole> Class

EntityFramework based implementation

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.EntityFramework.RoleStore<TRole>

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

Syntax

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

Type Parameters

  • TRole

The RoleStore<TRole> type exposes the following members.

Constructors

  Name Description
Public method RoleStore<TRole>() Default constuctor which uses a new instance of a default IdentityDbContext
Public method RoleStore<TRole>(DbContext) Constructor which takes a db context and wires up the stores with default instances using the context

Top

Properties

  Name Description
Public property Context Context for the store

Top

Methods

  Name Description
Public method CreateAsync Insert an entity
Public method DeleteAsync Mark an entity for deletion
Public method Dispose() Dispose the store
Protected method Dispose(Boolean) If disposing, calls dispose on the Context. Always nulls out the 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 ToString (Inherited from Object.)
Public method UpdateAsync Update an entity

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.EntityFramework Namespace