RoleManagerExtensions.FindByName<TRole> Method
Find a role by name
Namespace: Microsoft.AspNet.Identity
Assembly: Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function FindByName(Of TRole As {Class, IRole}) ( _
manager As RoleManager(Of TRole), _
roleName As String _
) As TRole
'Usage
Dim manager As RoleManager(Of TRole)
Dim roleName As String
Dim returnValue As TRole
returnValue = manager.FindByName(roleName)
public static TRole FindByName<TRole>(
this RoleManager<TRole> manager,
string roleName
)
where TRole : class, IRole
[ExtensionAttribute]
public:
generic<typename TRole>
where TRole : ref class, IRole
static TRole FindByName(
RoleManager<TRole>^ manager,
String^ roleName
)
static member FindByName :
manager:RoleManager<'TRole> *
roleName:string -> 'TRole when 'TRole : not struct and IRole
JScript does not support generic types and methods.
Type Parameters
- TRole
Parameters
- manager
Type: Microsoft.AspNet.Identity.RoleManager<TRole>
- roleName
Type: System.String
Return Value
Type: TRole
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).