IdentityExtensions.GetUserName Method
Returns 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
- identity
Type: System.Security.Principal.IIdentity
The identity.
Return Value
Type: System.String
The user name.
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.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).
See Also
Reference
Microsoft.AspNet.Identity Namespace