Dela via


RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim> Class

Definition

Creates a new instance of a persistence store for roles.

generic <typename TRole, typename TContext, typename TKey, typename TUserRole, typename TRoleClaim>
 where TRole : IdentityRole<TKey, TUserRole, TRoleClaim> where TContext : DbContext where TKey : IEquatable<TKey> where TUserRole : IdentityUserRole<TKey> where TRoleClaim : IdentityRoleClaim<TKey>public ref class RoleStore abstract : IDisposable, Microsoft::AspNetCore::Identity::IQueryableRoleStore<TRole>, Microsoft::AspNetCore::Identity::IRoleClaimStore<TRole>, Microsoft::AspNetCore::Identity::IRoleStore<TRole>
generic <typename TRole, typename TContext, typename TKey, typename TUserRole, typename TRoleClaim>
 where TRole : IdentityRole<TKey> where TContext : DbContext where TKey : IEquatable<TKey> where TUserRole : IdentityUserRole<TKey>gcnew() where TRoleClaim : IdentityRoleClaim<TKey>gcnew()public ref class RoleStore : IDisposable, Microsoft::AspNetCore::Identity::IQueryableRoleStore<TRole>, Microsoft::AspNetCore::Identity::IRoleClaimStore<TRole>, Microsoft::AspNetCore::Identity::IRoleStore<TRole>
public abstract class RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim> : IDisposable, Microsoft.AspNetCore.Identity.IQueryableRoleStore<TRole>, Microsoft.AspNetCore.Identity.IRoleClaimStore<TRole>, Microsoft.AspNetCore.Identity.IRoleStore<TRole> where TRole : IdentityRole<TKey,TUserRole,TRoleClaim> where TContext : DbContext where TKey : IEquatable<TKey> where TUserRole : IdentityUserRole<TKey> where TRoleClaim : IdentityRoleClaim<TKey>
public class RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim> : IDisposable, Microsoft.AspNetCore.Identity.IQueryableRoleStore<TRole>, Microsoft.AspNetCore.Identity.IRoleClaimStore<TRole>, Microsoft.AspNetCore.Identity.IRoleStore<TRole> where TRole : IdentityRole<TKey> where TContext : DbContext where TKey : IEquatable<TKey> where TUserRole : IdentityUserRole<TKey>, new() where TRoleClaim : IdentityRoleClaim<TKey>, new()
type RoleStore<'Role, 'Context, 'Key, 'UserRole, 'RoleClaim (requires 'Role :> IdentityRole<'Key, 'UserRole, 'RoleClaim> and 'Context :> DbContext and 'Key :> IEquatable<'Key> and 'UserRole :> IdentityUserRole<'Key> and 'RoleClaim :> IdentityRoleClaim<'Key>)> = class
    interface IQueryableRoleStore<'Role (requires 'Role :> IdentityRole<'Key, 'UserRole, 'RoleClaim>)>
    interface IRoleStore<'Role (requires 'Role :> IdentityRole<'Key, 'UserRole, 'RoleClaim>)>
    interface IDisposable
    interface IRoleClaimStore<'Role (requires 'Role :> IdentityRole<'Key, 'UserRole, 'RoleClaim>)>
type RoleStore<'Role, 'Context, 'Key, 'UserRole, 'RoleClaim (requires 'Role :> IdentityRole<'Key> and 'Context :> DbContext and 'Key :> IEquatable<'Key> and 'UserRole :> IdentityUserRole<'Key> and 'UserRole : (new : unit -> 'UserRole) and 'RoleClaim :> IdentityRoleClaim<'Key> and 'RoleClaim : (new : unit -> 'RoleClaim))> = class
    interface IQueryableRoleStore<'Role (requires 'Role :> IdentityRole<'Key>)>
    interface IRoleStore<'Role (requires 'Role :> IdentityRole<'Key>)>
    interface IDisposable
    interface IRoleClaimStore<'Role (requires 'Role :> IdentityRole<'Key>)>
Public MustInherit Class RoleStore(Of TRole, TContext, TKey, TUserRole, TRoleClaim)
Implements IDisposable, IQueryableRoleStore(Of TRole), IRoleClaimStore(Of TRole), IRoleStore(Of TRole)
Public Class RoleStore(Of TRole, TContext, TKey, TUserRole, TRoleClaim)
Implements IDisposable, IQueryableRoleStore(Of TRole), IRoleClaimStore(Of TRole), IRoleStore(Of TRole)

Type Parameters

TRole

The type of the class representing a role.

TContext

The type of the data context class used to access the store.

TKey

The type of the primary key for a role.

TUserRole

The type of the class representing a user role.

TRoleClaim

The type of the class representing a role claim.

Inheritance
RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>
Derived
Implements

Constructors

RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>(TContext, IdentityErrorDescriber)

Constructs a new instance of RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>.

Properties

AutoSaveChanges

Gets or sets a flag indicating if changes should be persisted after CreateAsync, UpdateAsync and DeleteAsync are called.

Context

Gets the database context for this store.

ErrorDescriber

Gets or sets the IdentityErrorDescriber for any error that occurred with the current operation.

Roles

A navigation property for the roles the store contains.

Methods

AddClaimAsync(TRole, Claim, CancellationToken)

Adds the claim given to the specified role.

ConvertIdFromString(String)

Converts the provided id to a strongly typed key object.

ConvertIdToString(TKey)

Converts the provided id to its string representation.

CreateAsync(TRole, CancellationToken)

Creates a new role in a store as an asynchronous operation.

CreateRoleClaim(TRole, Claim)

Creates an entity representing a role claim.

DeleteAsync(TRole, CancellationToken)

Deletes a role from the store as an asynchronous operation.

Dispose()

Dispose the stores

FindByIdAsync(String, CancellationToken)

Finds the role who has the specified ID as an asynchronous operation.

FindByNameAsync(String, CancellationToken)

Finds the role who has the specified normalized name as an asynchronous operation.

GetClaimsAsync(TRole, CancellationToken)

Get the claims associated with the specified role as an asynchronous operation.

GetNormalizedRoleNameAsync(TRole, CancellationToken)

Get a role's normalized name as an asynchronous operation.

GetRoleIdAsync(TRole, CancellationToken)

Gets the ID for a role from the store as an asynchronous operation.

GetRoleNameAsync(TRole, CancellationToken)

Gets the name of a role from the store as an asynchronous operation.

RemoveClaimAsync(TRole, Claim, CancellationToken)

Removes the claim given from the specified role.

SaveChanges(CancellationToken)

Saves the current store.

SetNormalizedRoleNameAsync(TRole, String, CancellationToken)

Set a role's normalized name as an asynchronous operation.

SetRoleNameAsync(TRole, String, CancellationToken)

Sets the name of a role in the store as an asynchronous operation.

ThrowIfDisposed()

Throws if this class has been disposed.

UpdateAsync(TRole, CancellationToken)

Updates a role in a store as an asynchronous operation.

Applies to