RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>.SetRoleNameAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将存储区中的角色名称设置为异步操作。
public System.Threading.Tasks.Task SetRoleNameAsync (TRole role, string roleName, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task SetRoleNameAsync (TRole role, string roleName, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task SetRoleNameAsync (TRole role, string? roleName, System.Threading.CancellationToken cancellationToken = default);
abstract member SetRoleNameAsync : 'Role * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.SetRoleNameAsync : 'Role * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SetRoleNameAsync (role As TRole, roleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task
Public Overridable Function SetRoleNameAsync (role As TRole, roleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task
参数
- role
- TRole
应设置其名称的角色。
- roleName
- String
角色的名称。
- cancellationToken
- CancellationToken
CancellationToken,用于传播应取消操作的通知。
返回
表示异步操作的 Task。