RoleStore<TRole, TContext, TKey> Class

Syntax

public class RoleStore<TRole, TContext, TKey> : IQueryableRoleStore<TRole>, IRoleClaimStore<TRole>, IRoleStore<TRole>, IDisposable where TRole : IdentityRole<TKey> where TContext : DbContext where TKey : IEquatable<TKey>

GitHub

View on GitHub

class Microsoft.AspNet.Identity.EntityFramework.RoleStore<TRole, TContext, TKey>

Constructors

RoleStore(TContext, Microsoft.AspNet.Identity.IdentityErrorDescriber)
public RoleStore(TContext context, IdentityErrorDescriber describer = null)

Methods

AddClaimAsync(TRole, System.Security.Claims.Claim, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task
public Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = null)
ConvertIdFromString(System.String)
Return type:{TKey}
public virtual TKey ConvertIdFromString(string id)
ConvertIdToString(TKey)
Return type:System.String
public virtual string ConvertIdToString(TKey id)
CreateAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}
public virtual Task<IdentityResult> CreateAsync(TRole role, CancellationToken cancellationToken = null)
DeleteAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}
public virtual Task<IdentityResult> DeleteAsync(TRole role, CancellationToken cancellationToken = null)
Dispose()

Dispose the store

public void Dispose()
FindByIdAsync(System.String, System.Threading.CancellationToken)

Find a role by id

Return type:System.Threading.Tasks.Task{{TRole}}
public virtual Task<TRole> FindByIdAsync(string id, CancellationToken cancellationToken = null)
FindByNameAsync(System.String, System.Threading.CancellationToken)

Find a role by normalized name

Return type:System.Threading.Tasks.Task{{TRole}}
public virtual Task<TRole> FindByNameAsync(string normalizedName, CancellationToken cancellationToken = null)
GetClaimsAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{System.Collections.Generic.IList{System.Security.Claims.Claim}}
public Task<IList<Claim>> GetClaimsAsync(TRole role, CancellationToken cancellationToken = null)
GetNormalizedRoleNameAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{System.String}
public virtual Task<string> GetNormalizedRoleNameAsync(TRole role, CancellationToken cancellationToken = null)
GetRoleIdAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{System.String}
public Task<string> GetRoleIdAsync(TRole role, CancellationToken cancellationToken = null)
GetRoleNameAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{System.String}
public Task<string> GetRoleNameAsync(TRole role, CancellationToken cancellationToken = null)
RemoveClaimAsync(TRole, System.Security.Claims.Claim, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task
public Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = null)
SetNormalizedRoleNameAsync(TRole, System.String, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task
public virtual Task SetNormalizedRoleNameAsync(TRole role, string normalizedName, CancellationToken cancellationToken = null)
SetRoleNameAsync(TRole, System.String, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task
public Task SetRoleNameAsync(TRole role, string roleName, CancellationToken cancellationToken = null)
UpdateAsync(TRole, System.Threading.CancellationToken)
Return type:System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}
public virtual Task<IdentityResult> UpdateAsync(TRole role, CancellationToken cancellationToken = null)

Properties

AutoSaveChanges()

If true will call SaveChanges after CreateAsync/UpdateAsync/DeleteAsync

Return type:System.Boolean
public bool AutoSaveChanges { get; set; }
Context()
Return type:{TContext}
public TContext Context { get; }
ErrorDescriber()

Used to generate public API error messages

Return type:Microsoft.AspNet.Identity.IdentityErrorDescriber
public IdentityErrorDescriber ErrorDescriber { get; set; }
Roles()
Return type:System.Linq.IQueryable{{TRole}}
public virtual IQueryable<TRole> Roles { get; }