IdentityExtensions.GetUserId Method

 

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

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static GetUserId(IIdentity)

Returns the user ID using the UserIdClaimType.

System_CAPS_pubmethodSystem_CAPS_static GetUserId<T>(IIdentity)

Return the user id using the UserIdClaimType

See Also

IdentityExtensions Class
Microsoft.AspNet.Identity Namespace

Return to top

IdentityExtensions.GetUserId Method (IIdentity)

Returns the user ID using the UserIdClaimType.

Syntax

public static string GetUserId(
    this IIdentity identity
)
public:
[ExtensionAttribute]
static String^ GetUserId(
    IIdentity^ identity
)
static member GetUserId : 
        identity:IIdentity -> string
<ExtensionAttribute>
Public Shared Function GetUserId (
    identity As IIdentity
) As String

Parameters

Return Value

Type: System.String

The user ID.

See Also

ASP.NET Identity

Return to top

IdentityExtensions.GetUserId<T> Method (IIdentity)

Return the user id using the UserIdClaimType

Syntax

public static T GetUserId<T>(
    this IIdentity identity
)
where T : IConvertible
public:
generic<typename T>
where T : IConvertible
[ExtensionAttribute]
static T GetUserId(
    IIdentity^ identity
)
static member GetUserId<'T when 'T : IConvertible> : 
        identity:IIdentity -> 'T
<ExtensionAttribute>
Public Shared Function GetUserId(Of T As IConvertible) (
    identity As IIdentity
) As T

Parameters

Return Value

Type: T

Type Parameters

  • T

Return to top