Share via


UserManager<TUser, TKey>.IsInRoleAsync Method (TKey, String)

 

Determines whether the user is in the specified role.

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

Syntax

public virtual Task<bool> IsInRoleAsync(
    TKey userId,
    string role
)
public:
virtual Task<bool>^ IsInRoleAsync(
    TKey userId,
    String^ role
)
abstract IsInRoleAsync : 
        userId:'TKey *
        role:string -> Task<bool>
override IsInRoleAsync : 
        userId:'TKey *
        role:string -> Task<bool>
Public Overridable Function IsInRoleAsync (
    userId As TKey,
    role As String
) As Task(Of Boolean)

Parameters

  • userId
    Type: TKey

    The user ID.

Return Value

Type: System.Threading.Tasks.Task<Boolean>

The task representing the asynchronous operation.

See Also

UserManager<TUser, TKey> Class
Microsoft.AspNet.Identity Namespace
ASP.NET Identity

Return to top