Language

RoleStore<TRole, TKey, TUserRole> Class

 

Represents an Entity Framework implementation of a role store.

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

Inheritance Hierarchy

System.Object   Microsoft.AspNet.Identity.EntityFramework.RoleStore<TRole, TKey, TUserRole>     Microsoft.AspNet.Identity.EntityFramework.RoleStore<TRole>

Syntax

public class RoleStore<TRole, TKey, TUserRole> : IQueryableRoleStore<TRole, TKey>,
    IRoleStore<TRole, TKey>, IDisposable
where TRole : new(), IdentityRole<TKey, TUserRole>
where TUserRole : new(), IdentityUserRole<TKey>
generic<typename TRole, typename TKey, typename TUserRole>
where TRole : gcnew(), IdentityRole<TKey, TUserRole>
where TUserRole : gcnew(), IdentityUserRole<TKey>
public ref class RoleStore : IQueryableRoleStore<TRole, TKey>,
    IRoleStore<TRole, TKey>, IDisposable
type RoleStore<'TRole, 'TKey, 'TUserRole when 'TRole : new() and IdentityRole<'TKey, 'TUserRole> when 'TUserRole : new() and IdentityUserRole<'TKey>> =
    class
        interface IQueryableRoleStore<'TRole, 'TKey>
        interface IRoleStore<'TRole, 'TKey>
        interface IDisposable
    end
Public Class RoleStore(Of TRole As { IdentityRole(Of TKey, TUserRole), New }, TKey, TUserRole As { IdentityUserRole(Of TKey), New })
    Implements IQueryableRoleStore(Of TRole, TKey), IRoleStore(Of TRole, TKey),
    IDisposable

Type Parameters

  • TRole The type of the role.
  • TKey The type of the key.
  • TUserRole The type of the user role.

Constructors

Name Description
RoleStore<TRole, TKey, TUserRole>(DbContext) Initializes a new instance of the RoleStore<TRole, TKey, TUserRole> class which takes a database context and wires up the stores with default instances using the context.

Properties

Name Description
Context Gets the context for the store.
DisposeContext Gets or sets a value that indicates whether to call dispose on the DbContext during Dispose.
Roles Gets an IQueryable<T> of users.

Methods

Name Description
CreateAsync(TRole) Asynchronously inserts an entity.
DeleteAsync(TRole) Asynchronously marks an entity for deletion.
Dispose() Releases all resources used by the current instance of the RoleStore<TRole, TKey, TUserRole>.
Dispose(Boolean) Releases the unmanaged resources used by the RoleStore<TRole, TKey, TUserRole> class and optionally releases the managed resources.
Equals(Object) (Inherited from Object.)
Finalize() (Inherited from Object.)
FindByIdAsync(TKey) Asynchronously finds a role by using the specified identifier.
FindByNameAsync(String) Asynchronously finds a role by name.
GetHashCode() (Inherited from Object.)
GetType() (Inherited from Object.)
MemberwiseClone() (Inherited from Object.)
ToString() (Inherited from Object.)
UpdateAsync(TRole) Asynchronously updates an entity.

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.EntityFramework Namespace [ASP.NET Identity](https://go.microsoft.com/fwlink/p/?linkid=393664.

Return to top