UserStore<TUser> Class

Implements IUserStore using EntityFramework where TUser is the entity type of the user being stored

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.EntityFramework.UserStore<TUser>

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

Syntax

'Declaration
Public Class UserStore(Of TUser As IdentityUser) _
    Implements IUserLoginStore(Of TUser), IUserClaimStore(Of TUser),  _
    IUserRoleStore(Of TUser), IUserPasswordStore(Of TUser), IUserSecurityStampStore(Of TUser),  _
    IUserStore(Of TUser), IDisposable
'Usage
Dim instance As UserStore(Of TUser)
public class UserStore<TUser> : IUserLoginStore<TUser>, 
    IUserClaimStore<TUser>, IUserRoleStore<TUser>, IUserPasswordStore<TUser>, IUserSecurityStampStore<TUser>, 
    IUserStore<TUser>, IDisposable 
where TUser : IdentityUser
generic<typename TUser>
where TUser : IdentityUser 
public ref class UserStore : IUserLoginStore<TUser>, 
    IUserClaimStore<TUser>, IUserRoleStore<TUser>, IUserPasswordStore<TUser>, IUserSecurityStampStore<TUser>, 
    IUserStore<TUser>, IDisposable
type UserStore<'TUser when 'TUser : IdentityUser> =  
    class 
        interface IUserLoginStore<'TUser>
        interface IUserClaimStore<'TUser>
        interface IUserRoleStore<'TUser>
        interface IUserPasswordStore<'TUser>
        interface IUserSecurityStampStore<'TUser>
        interface IUserStore<'TUser>
        interface IDisposable 
    end
JScript does not support generic types and methods.

Type Parameters

  • TUser

The UserStore<TUser> type exposes the following members.

Constructors

  Name Description
Public method UserStore<TUser>() Default constuctor which uses a new instance of a default EntityyDbContext
Public method UserStore<TUser>(DbContext) Constructor that takes the db context

Top

Properties

  Name Description
Public property AutoSaveChanges If true will call SaveChanges after Create/Update/Delete
Public property Context Context for the store
Public property DisposeContext If true will call dispose on the DbContext during Dipose

Top

Methods

  Name Description
Public method AddClaimAsync Add a claim to a user
Public method AddLoginAsync Add a login to the user
Public method AddToRoleAsync Add a user to a role
Public method CreateAsync Insert an entity
Public method DeleteAsync Mark an entity for deletion
Public method Dispose() Dispose the store
Protected method Dispose(Boolean) If disposing, calls dispose on the Context. Always nulls out the Context
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method FindAsync Returns the user associated with this login
Public method FindByIdAsync Find a user by id
Public method FindByNameAsync Find a user by name
Public method GetClaimsAsync Return the claims for a user
Public method GetHashCode (Inherited from Object.)
Public method GetLoginsAsync Get the logins for a user
Public method GetPasswordHashAsync Get the password hash for a user
Public method GetRolesAsync Get the names of the roles a user is a member of
Public method GetSecurityStampAsync Get the security stamp for a user
Public method GetType (Inherited from Object.)
Public method HasPasswordAsync Returns true if the user has a password set
Public method IsInRoleAsync Returns true if the user is in the named role
Protected method MemberwiseClone (Inherited from Object.)
Public method RemoveClaimAsync Remove a claim from a user
Public method RemoveFromRoleAsync Remove a user from a role
Public method RemoveLoginAsync Remove a login from a user
Public method SetPasswordHashAsync Set the password hash for a user
Public method SetSecurityStampAsync Set the security stamp for the user
Public method ToString (Inherited from Object.)
Public method UpdateAsync Update an entity

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.AspNet.Identity.EntityFramework Namespace