UserStore<TUser> Class

 

Represents an Entity Framework implementation of a store that supports IUserStore, IUserLoginStore, IUserClaimStore and IUserRoleStore.

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

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.EntityFramework.UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>
    Microsoft.AspNet.Identity.EntityFramework.UserStore<TUser>

Syntax

public class UserStore<TUser> : UserStore<TUser, IdentityRole, string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim>, 
    IUserStore<TUser>, IUserStore<TUser, string>, IDisposable
where TUser : IdentityUser
generic<typename TUser>
where TUser : IdentityUser
public ref class UserStore : UserStore<TUser, IdentityRole^, String^, IdentityUserLogin^, IdentityUserRole^, IdentityUserClaim^>, 
    IUserStore<TUser>, IUserStore<TUser, String^>, IDisposable
type UserStore<'TUser when 'TUser : IdentityUser> = 
    class
        inherit UserStore<'TUser, IdentityRole, string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim>
        interface IUserStore<'TUser>
        interface IUserStore<'TUser, string>
        interface IDisposable
    end
Public Class UserStore(Of TUser As IdentityUser)
    Inherits UserStore(Of TUser, IdentityRole, String, IdentityUserLogin, IdentityUserRole, IdentityUserClaim)
    Implements IUserStore(Of TUser), IUserStore(Of TUser, String), IDisposable

Type Parameters

  • TUser
    The type of the user.

Constructors

Name Description
System_CAPS_pubmethod UserStore<TUser>()

Initializes a new instance of the UserStore<TUser> class which uses a new instance of a default EntityyDbContext.

System_CAPS_pubmethod UserStore<TUser>(DbContext)

Initializes a new instance of the UserStore<TUser> class.

Properties

Name Description
System_CAPS_pubproperty AutoSaveChanges

Gets or sets a value that indicates whether to call SaveChanges after Create/Update/Delete.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubproperty Context

Gets the context for the store.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubproperty DisposeContext

Gets or sets whether to dispose the DbContext during Dispose.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubproperty Users

Gets an IQueryable<T> of users.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

Methods

Name Description
System_CAPS_pubmethod AddClaimAsync(TUser, Claim)

Asynchronously adds a claim to a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod AddLoginAsync(TUser, UserLoginInfo)

Asynchronously adds a login to the user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod AddToRoleAsync(TUser, String)

Asynchronously adds a user to a role.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod CreateAsync(TUser)

Asynchronously inserts an entity.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod DeleteAsync(TUser)

Asynchronously marks an entity for deletion.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod Dispose()

Releases all resources used by the current instance of the UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_protmethod Dispose(Boolean)

Releases the unmanaged resources used by the UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim> class and optionally releases the managed resources.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod FindAsync(UserLoginInfo)

Asynchronously returns the user associated with this login.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod FindByEmailAsync(String)

Asynchronously finds a user by e-mail.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod FindByIdAsync(TKey)

Asynchronously finds a user by ID.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod FindByNameAsync(String)

Asynchronously finds a user by name.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetAccessFailedCountAsync(TUser)

Asynchronously returns the current number of failed access attempts. This number usually will be reset whenever the password is verified or the account is locked out.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetClaimsAsync(TUser)

Asynchronously returns the claims for a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetEmailAsync(TUser)

Asynchronously gets the user's e-mail.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetEmailConfirmedAsync(TUser)

Asynchronously returns whether the user email is confirmed.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetLockoutEnabledAsync(TUser)

Asynchronously returns whether the user can be locked out.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetLockoutEndDateAsync(TUser)

Asynchronously returns the DateTimeOffset that represents the end of a user's lockout, any time in the past should be considered not locked out.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetLoginsAsync(TUser)

Asynchronously gets the logins for a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetPasswordHashAsync(TUser)

Asynchronously gets the password hash for a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetPhoneNumberAsync(TUser)

Asynchronously gets a user's phone number.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetPhoneNumberConfirmedAsync(TUser)

Asynchronously returns whether the user phone number is confirmed.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetRolesAsync(TUser)

Asynchronously gets the names of the roles a user is a member of.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetSecurityStampAsync(TUser)

Asynchronously gets the security stamp for a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetTwoFactorEnabledAsync(TUser)

Asynchronously determines whether the two-factor providers are enabled for the user. (Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod GetUserAggregateAsync(Expression<Func<TUser, Boolean>>)

Used to attach child entities to the User aggregate, i.e. Roles, Logins, and Claims(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod HasPasswordAsync(TUser)

Asynchronously determines whether the user has a password set.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod IncrementAccessFailedCountAsync(TUser)

Asynchronously records the failed attempt to access the user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod IsInRoleAsync(TUser, String)

Asynchronously determines whether the user is in the named role.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod RemoveClaimAsync(TUser, Claim)

Asynchronously removes a claim from a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod RemoveFromRoleAsync(TUser, String)

Asynchronously removes a user from a role.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod RemoveLoginAsync(TUser, UserLoginInfo)

Asynchronously removes a login from a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod ResetAccessFailedCountAsync(TUser)

Asynchronously resets the account access failed count, typically after the account is successfully accessed.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetEmailAsync(TUser, String)

Asynchronously sets the user e-mail.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetEmailConfirmedAsync(TUser, Boolean)

Asynchronously sets the IsConfirmed property for the user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetLockoutEnabledAsync(TUser, Boolean)

Asynchronously sets whether the user can be locked out.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetLockoutEndDateAsync(TUser, DateTimeOffset)

Asynchronously locks a user out until the specified end date (set to a past date, to unlock a user).(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetPasswordHashAsync(TUser, String)

Asynchronously sets the password hash for a user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetPhoneNumberAsync(TUser, String)

Asynchronously sets the user phone number.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetPhoneNumberConfirmedAsync(TUser, Boolean)

Asynchronously sets the PhoneNumberConfirmed property for the user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetSecurityStampAsync(TUser, String)

Asynchronously sets the security stamp for the user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod SetTwoFactorEnabledAsync(TUser, Boolean)

Asynchronously sets the Two Factor provider for the user.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod UpdateAsync(TUser)

Asynchronously updates an entity.(Inherited from UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim>.)

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

Microsoft.AspNet.Identity.EntityFramework Namespace
ASP.NET Identity

Return to top