RoleManagerExtensions.Create<TRole, TKey> Method

Creates a role.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Create(Of TRole As {Class, Object, IRole(Of TKey)}, TKey As {Object, IEquatable(Of TKey)}) ( _
    manager As RoleManager(Of TRole, TKey), _
    role As TRole _
) As IdentityResult
'Usage
Dim manager As RoleManager(Of TRole, TKey)
Dim role As TRole
Dim returnValue As IdentityResult 

returnValue = manager.Create(role)
public static IdentityResult Create<TRole, TKey>(
    this RoleManager<TRole, TKey> manager,
    TRole role
)
where TRole : class, Object, IRole<TKey>
where TKey : Object, IEquatable<TKey>
[ExtensionAttribute]
public:
generic<typename TRole, typename TKey>
where TRole : ref class, Object, IRole<TKey>
where TKey : Object, IEquatable<TKey>
static IdentityResult^ Create(
    RoleManager<TRole, TKey>^ manager, 
    TRole role
)
static member Create : 
        manager:RoleManager<'TRole, 'TKey> * 
        role:'TRole -> IdentityResult   when 'TRole : not struct and Object and IRole<'TKey> when 'TKey : Object and IEquatable<'TKey>
JScript does not support generic types and methods.

Type Parameters

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

Parameters

  • role
    Type: TRole
    The role to create.

Return Value

Type: Microsoft.AspNet.Identity.IdentityResult
The result of the operation.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type RoleManager<TRole, TKey>. 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.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).

See Also

Reference

RoleManagerExtensions Class

Microsoft.AspNet.Identity Namespace

Other Resources

ASP.NET Identity