UserManager<TUser, TKey>.IsInRoleAsync Method

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

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

returnValue = instance.IsInRoleAsync(userId, _
    role)
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 function IsInRoleAsync(
    userId : TKey, 
    role : String
) : Task<boolean>

Parameters

  • userId
    Type: TKey
    The user ID.

Return Value

Type: System.Threading.Tasks.Task<Boolean>
The task representing the asynchronous operation.

See Also

Reference

UserManager<TUser, TKey> Class

Microsoft.AspNet.Identity Namespace

Other Resources

ASP.NET Identity