Share via


RoleManagerExtensions.FindById<TRole, TKey> Method (RoleManager<TRole, TKey>, TKey)

 

Finds a role by ID.

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

Syntax

public static TRole FindById<TRole, TKey>(
    this RoleManager<TRole, TKey> manager,
    TKey roleId
)
where TRole : class, IRole<TKey>
where TKey : object, IEquatable<TKey>
public:
generic<typename TRole, typename TKey>
where TRole : ref class, IRole<TKey>
where TKey : Object, IEquatable<TKey>
[ExtensionAttribute]
static TRole FindById(
    RoleManager<TRole, TKey>^ manager,
    TKey roleId
)
static member FindById<'TRole, 'TKey when 'TRole : not struct and IRole<'TKey> when 'TKey : Object and IEquatable<'TKey>> : 
        manager:RoleManager<'TRole, 'TKey> *
        roleId:'TKey -> 'TRole
<ExtensionAttribute>
Public Shared Function FindById(Of TRole As { Class, IRole(Of TKey) }, TKey As { Object, IEquatable(Of TKey) }) (
    manager As RoleManager(Of TRole, TKey),
    roleId As TKey
) As TRole

Parameters

  • roleId
    Type: TKey

    The role ID.

Return Value

Type: TRole

The result of the operation.

Type Parameters

  • TRole
    The type of the role.
  • TKey
    The type of the key.

See Also

RoleManagerExtensions Class
Microsoft.AspNet.Identity Namespace
ASP.NET Identity

Return to top