UserManagerExtensions.Find<TUser, TKey> Method (UserManager<TUser, TKey>, String, String)

Returns a user with the specified username and password or null if there is no match.

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


<ExtensionAttribute> _
Public Shared Function Find(Of TUser As {Class, Object, IUser(Of TKey)}, TKey As {Object, IEquatable(Of TKey)}) ( _
    manager As UserManager(Of TUser, TKey), _
    userName As String, _
    password As String _
) As TUser
Dim manager As UserManager(Of TUser, TKey)
Dim userName As String 
Dim password As String 
Dim returnValue As TUser

returnValue = manager.Find(userName, _
public static TUser Find<TUser, TKey>(
    this UserManager<TUser, TKey> manager,
    string userName,
    string password
where TUser : class, Object, IUser<TKey>
where TKey : Object, IEquatable<TKey>
generic<typename TUser, typename TKey>
where TUser : ref class, Object, IUser<TKey>
where TKey : Object, IEquatable<TKey>
static TUser Find(
    UserManager<TUser, TKey>^ manager, 
    String^ userName, 
    String^ password
static member Find : 
        manager:UserManager<'TUser, 'TKey> * 
        userName:string * 
        password:string -> 'TUser  when 'TUser : not struct and Object and IUser<'TKey> when 'TKey : Object and IEquatable<'TKey>
JScript does not support generic types and methods.

Type Parameters

  • TUser
    The type of the user.
  • TKey
    The type of the key.


Return Value

Type: TUser
The result of the search.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type UserManager<TUser, TKey>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or

See Also


UserManagerExtensions Class

Find Overload

Microsoft.AspNet.Identity Namespace

Other Resources

ASP.NET Identity