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)
'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>
- userId
Type: TKey
The user ID.
- role
Type: System.String
The role.
Type: System.Threading.Tasks.Task<Boolean>
The task representing the asynchronous operation.
UserManager<TUser, TKey> Class