UserManager<'TUser, 'TKey>.AddToRolesAsync Method ('TKey, String[])
Method to add user to multiple roles
Namespace: Microsoft.AspNet.Identity
Assembly: Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)
Syntax
public virtual Task<IdentityResult> AddToRolesAsync(
TKey userId,
params string[] roles
)
public:
virtual Task<IdentityResult^>^ AddToRolesAsync(
TKey userId,
... array<String^>^ roles
)
abstract AddToRolesAsync :
userId:'TKey *
[<ParamArrayAttribute>] roles:string[] -> Task<IdentityResult>
override AddToRolesAsync :
userId:'TKey *
[<ParamArrayAttribute>] roles:string[] -> Task<IdentityResult>
Public Overridable Function AddToRolesAsync (
userId As TKey,
ParamArray roles As String()
) As Task(Of IdentityResult)
Parameters
userId
Type: TKeyuser id
roles
Type: System.String[]list of role names
Return Value
Type: System.Threading.Tasks.Task<IdentityResult>
See Also
UserManager<TUser, TKey> Class
Microsoft.AspNet.Identity Namespace
Return to top