Share via


IdentityExtensions.GetUserId Method

Return the user id using the UserIdClaimType.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetUserId ( _
    identity As IIdentity _
) As String
'Usage
Dim identity As IIdentity 
Dim returnValue As String 

returnValue = identity.GetUserId()
public static string GetUserId(
    this IIdentity identity
)
[ExtensionAttribute]
public:
static String^ GetUserId(
    IIdentity^ identity
)
static member GetUserId : 
        identity:IIdentity -> string
public static function GetUserId(
    identity : IIdentity
) : String

Parameters

Return Value

Type: System.String
Returns String.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IIdentity. 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

IdentityExtensions Class

Microsoft.AspNet.Identity Namespace