IdentityExtensions.GetUserName Method

Return the user name using the UserNameClaimType.

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

Syntax

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

returnValue = identity.GetUserName()
public static string GetUserName(
    this IIdentity identity
)
[ExtensionAttribute]
public:
static String^ GetUserName(
    IIdentity^ identity
)
static member GetUserName : 
        identity:IIdentity -> string
public static function GetUserName(
    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