IRoleStore<TRole> Interface

Summary

Provides an abstraction for a storage and management of roles.

Syntax

public interface IRoleStore<TRole> : IDisposable where TRole : class

GitHub

View on GitHub

interface Microsoft.AspNet.Identity.IRoleStore<TRole>

Methods

CreateAsync(TRole, System.Threading.CancellationToken)

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

Arguments:
  • role ({TRole}) – The role to create in the store.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that represents the <see cref=”T:Microsoft.AspNet.Identity.IdentityResult” /> of the asynchronous query.

Task<IdentityResult> CreateAsync(TRole role, CancellationToken cancellationToken)
DeleteAsync(TRole, System.Threading.CancellationToken)

Deletes a role from the store as an asynchronous operation.

Arguments:
  • role ({TRole}) – The role to delete from the store.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that represents the <see cref=”T:Microsoft.AspNet.Identity.IdentityResult” /> of the asynchronous query.

Task<IdentityResult> DeleteAsync(TRole role, CancellationToken cancellationToken)
FindByIdAsync(System.String, System.Threading.CancellationToken)

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

Arguments:
  • roleId (System.String) – The role ID to look for.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{{TRole}}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that result of the look up.

Task<TRole> FindByIdAsync(string roleId, CancellationToken cancellationToken)
FindByNameAsync(System.String, System.Threading.CancellationToken)

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

Arguments:
  • normalizedRoleName (System.String) – The normalized role name to look for.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{{TRole}}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that result of the look up.

Task<TRole> FindByNameAsync(string normalizedRoleName, CancellationToken cancellationToken)
GetNormalizedRoleNameAsync(TRole, System.Threading.CancellationToken)

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

Arguments:
  • role ({TRole}) – The role whose normalized name should be retrieved.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{System.String}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that contains the name of the role.

Task<string> GetNormalizedRoleNameAsync(TRole role, CancellationToken cancellationToken)
GetRoleIdAsync(TRole, System.Threading.CancellationToken)

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

Arguments:
  • role ({TRole}) – The role whose ID should be returned.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{System.String}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that contains the ID of the role.

Task<string> GetRoleIdAsync(TRole role, CancellationToken cancellationToken)
GetRoleNameAsync(TRole, System.Threading.CancellationToken)

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

Arguments:
  • role ({TRole}) – The role whose name should be returned.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{System.String}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that contains the name of the role.

Task<string> GetRoleNameAsync(TRole role, CancellationToken cancellationToken)
SetNormalizedRoleNameAsync(TRole, System.String, System.Threading.CancellationToken)

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

Arguments:
  • role ({TRole}) – The role whose normalized name should be set.
  • normalizedName (System.String) – The normalized name to set
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation.

Task SetNormalizedRoleNameAsync(TRole role, string normalizedName, CancellationToken cancellationToken)
SetRoleNameAsync(TRole, System.String, System.Threading.CancellationToken)

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

Arguments:
  • role ({TRole}) – The role whose name should be set.
  • roleName (System.String) – The name of the role.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation.

Task SetRoleNameAsync(TRole role, string roleName, CancellationToken cancellationToken)
UpdateAsync(TRole, System.Threading.CancellationToken)

Updates a role in a store as an asynchronous operation.

Arguments:
  • role ({TRole}) – The role to update in the store.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}

Returns:

A <see cref=”T:System.Threading.Tasks.Task`1” /> that represents the <see cref=”T:Microsoft.AspNet.Identity.IdentityResult” /> of the asynchronous query.

Task<IdentityResult> UpdateAsync(TRole role, CancellationToken cancellationToken)