ApplicationUserStoreTUserAddToRoleAsync Method |
Add the specified user to the named role.
Namespace: Kentico.MembershipAssembly: Kentico.Membership (in Kentico.Membership.dll) Version: 13.0.131
Syntax public Task AddToRoleAsync(
TUser user,
string roleName,
CancellationToken cancellationToken
)
Parameters
- user
- Type: TUser
The user to add to the named role. - roleName
- Type: SystemString
The name of the role to add the user to. - cancellationToken
- Type: System.ThreadingCancellationToken
The CancellationToken used to propagate notifications that the operation should be canceled.
Return Value
Type:
Task
The
Task that represents the asynchronous operation.
Implements
IUserRoleStore.AddToRoleAsync(UTP, String, CancellationToken)Exceptions Exception | Condition |
---|
ArgumentNullException | user is null. |
ArgumentException | roleName is null or empty. |
See Also