RoleManagerExtensions.RoleExists<TRole> Method

Returns true if the role exists

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function RoleExists(Of TRole As {Class, IRole}) ( _
    manager As RoleManager(Of TRole), _
    roleName As String _
) As Boolean
'Usage
Dim manager As RoleManager(Of TRole)
Dim roleName As String 
Dim returnValue As Boolean 

returnValue = manager.RoleExists(roleName)
public static bool RoleExists<TRole>(
    this RoleManager<TRole> manager,
    string roleName
)
where TRole : class, IRole
[ExtensionAttribute]
public:
generic<typename TRole>
where TRole : ref class, IRole 
static bool RoleExists(
    RoleManager<TRole>^ manager, 
    String^ roleName
)
static member RoleExists : 
        manager:RoleManager<'TRole> * 
        roleName:string -> bool   when 'TRole : not struct and IRole
JScript does not support generic types and methods.

Type Parameters

  • TRole

Parameters

Return Value

Type: System.Boolean

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type RoleManager<TRole>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.111) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.111).

See Also

Reference

RoleManagerExtensions Class

Microsoft.AspNet.Identity Namespace