Language

IUserRoleStore<TUser, TKey>.AddToRoleAsync Method (TUser, String)

 

Asynchronously adds a user to a role.

Namespace:   Microsoft.AspNet.Identity Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

Task AddToRoleAsync(
    TUser user,
    string roleName
)
Task^ AddToRoleAsync(
    TUser user,
    String^ roleName
)
abstract AddToRoleAsync :
        user:'TUser *
        roleName:string -> Task
Function AddToRoleAsync (
    user As TUser,
    roleName As String
) As Task

Parameters

  • user Type: TUser

    The user.

Return Value

Type: System.Threading.Tasks.Task

The task object representing the asynchronous operation.

See Also

IUserRoleStore<TUser, TKey> Interface Microsoft.AspNet.Identity Namespace [ASP.NET Identity](https://go.microsoft.com/fwlink/p/?linkid=393664.

Return to top