IUserRoleStore<TUser>.AddToRoleAsync 方法

定义

将指定的 user 添加到命名角色。

public:
 System::Threading::Tasks::Task ^ AddToRoleAsync(TUser user, System::String ^ roleName, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task AddToRoleAsync (TUser user, string roleName, System.Threading.CancellationToken cancellationToken);
abstract member AddToRoleAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function AddToRoleAsync (user As TUser, roleName As String, cancellationToken As CancellationToken) As Task

参数

user
TUser

要添加到命名角色的用户。

roleName
String

要向其添加用户的角色的名称。

cancellationToken
CancellationToken

CancellationToken,用于传播应取消操作的通知。

返回

表示异步操作的 Task

适用于