IdentityExtensions.GetUserId Method
Namespace: Microsoft.AspNet.Identity
Assembly: Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)
Overload List
Name | Description | |
---|---|---|
![]() ![]() |
GetUserId(IIdentity) | Returns the user ID using the UserIdClaimType. |
![]() ![]() |
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
identity
Type: System.Security.Principal.IIdentityThe identity.
Return Value
Type: System.String
The user ID.
See Also
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
- identity
Type: System.Security.Principal.IIdentity
Return Value
Type: T
Type Parameters
- T
Return to top