UserManager<TUser>.IsInRoleAsync Method

Returns true if the user is in the specified role

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

Syntax

'Declaration
Public Overridable Function IsInRoleAsync ( _
    userId As String, _
    role As String _
) As Task(Of Boolean)
'Usage
Dim instance As UserManager 
Dim userId As String 
Dim role As String 
Dim returnValue As Task(Of Boolean)

returnValue = instance.IsInRoleAsync(userId, _
    role)
public virtual Task<bool> IsInRoleAsync(
    string userId,
    string role
)
public:
virtual Task<bool>^ IsInRoleAsync(
    String^ userId, 
    String^ role
)
abstract IsInRoleAsync : 
        userId:string * 
        role:string -> Task<bool> 
override IsInRoleAsync : 
        userId:string * 
        role:string -> Task<bool> 
public function IsInRoleAsync(
    userId : String, 
    role : String
) : Task<boolean>

Parameters

Return Value

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

See Also

Reference

UserManager<TUser> Class

Microsoft.AspNet.Identity Namespace