IUserStore<TUser> Interface

Provides an abstraction for a store which manages user accounts.

Namespace
Microsoft.AspNetCore.Identity
Assemblies
  • Microsoft.AspNetCore.Identity

Syntax

public interface IUserStore<TUser> : IDisposable where TUser : class
interface Microsoft.AspNetCore.Identity.IUserStore<TUser>

Methods

CreateAsync(TUser, System.Threading.CancellationToken)

Creates the specified <em>user</em> in the user store.

Arguments:
  • user (TUser) – The user to create.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the creation operation.

Task<IdentityResult> CreateAsync(TUser user, CancellationToken cancellationToken)
DeleteAsync(TUser, System.Threading.CancellationToken)

Deletes the specified <em>user</em> from the user store.

Arguments:
  • user (TUser) – The user to delete.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the update operation.

Task<IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken)
FindByIdAsync(System.String, System.Threading.CancellationToken)

Finds and returns a user, if any, who has the specified <em>userId</em>.

Arguments:
  • userId (System.String) – The user ID to search for.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<TUser>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the user matching the specified <em>userId</em> if it exists.

Task<TUser> FindByIdAsync(string userId, CancellationToken cancellationToken)
FindByNameAsync(System.String, System.Threading.CancellationToken)

Finds and returns a user, if any, who has the specified normalized user name.

Arguments:
  • normalizedUserName (System.String) – The normalized user name to search for.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<TUser>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the user matching the specified <em>normalizedUserName</em> if it exists.

Task<TUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
GetNormalizedUserNameAsync(TUser, System.Threading.CancellationToken)

Gets the normalized user name for the specified <em>user</em>.

Arguments:
  • user (TUser) – The user whose normalized name should be retrieved.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<System.String>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the normalized user name for the specified <em>user</em>.

Task<string> GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken)
GetUserIdAsync(TUser, System.Threading.CancellationToken)

Gets the user identifier for the specified <em>user</em>.

Arguments:
  • user (TUser) – The user whose identifier should be retrieved.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<System.String>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the identifier for the specified <em>user</em>.

Task<string> GetUserIdAsync(TUser user, CancellationToken cancellationToken)
GetUserNameAsync(TUser, System.Threading.CancellationToken)

Gets the user name for the specified <em>user</em>.

Arguments:
  • user (TUser) – The user whose name should be retrieved.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<System.String>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the name for the specified <em>user</em>.

Task<string> GetUserNameAsync(TUser user, CancellationToken cancellationToken)
SetNormalizedUserNameAsync(TUser, System.String, System.Threading.CancellationToken)

Sets the given normalized name for the specified <em>user</em>.

Arguments:
  • user (TUser) – The user whose name should be set.
  • normalizedName (System.String) – The normalized name to set.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation.

Task SetNormalizedUserNameAsync(TUser user, string normalizedName, CancellationToken cancellationToken)
SetUserNameAsync(TUser, System.String, System.Threading.CancellationToken)

Sets the given <em>userName</em> for the specified <em>user</em>.

Arguments:
  • user (TUser) – The user whose name should be set.
  • userName (System.String) – The user name to set.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation.

Task SetUserNameAsync(TUser user, string userName, CancellationToken cancellationToken)
UpdateAsync(TUser, System.Threading.CancellationToken)

Updates the specified <em>user</em> in the user store.

Arguments:
  • user (TUser) – The user to update.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the Microsoft.AspNetCore.Identity.IdentityResult of the update operation.

Task<IdentityResult> UpdateAsync(TUser user, CancellationToken cancellationToken)