UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.AddToRoleAsync Method (TUser, String)

 

Asynchronously adds a user to a role.

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

Syntax

public virtual Task AddToRoleAsync(
    TUser user,
    string roleName
)
public:
virtual Task^ AddToRoleAsync(
    TUser user,
    String^ roleName
)
abstract AddToRoleAsync : 
        user:'TUser *
        roleName:string -> Task
override AddToRoleAsync : 
        user:'TUser *
        roleName:string -> Task
Public Overridable 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 representing the asynchronous operation.

Implements

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

See Also

UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim> Class
Microsoft.AspNet.Identity.EntityFramework Namespace
ASP.NET Identity

Return to top