IUserStore<TUser> Interface

Summary

Provides an abstraction for a store which manages user accounts.

Syntax

public interface IUserStore<TUser> : IDisposable where TUser : class

GitHub

View on GitHub

interface Microsoft.AspNet.Identity.IUserStore<TUser>

Methods

CreateAsync(TUser, System.Threading.CancellationToken)

Creates the specified user in the user store, as an asynchronous operation.

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.AspNet.Identity.IdentityResult}

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the <see cref=”T:Microsoft.AspNet.Identity.IdentityResult” /> of the creation operation.

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

Deletes the specified user from the user store, as an asynchronous operation.

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.AspNet.Identity.IdentityResult}

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the <see cref=”T:Microsoft.AspNet.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 userId.

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 <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the user matching the specified <paramref name=”userID” /> 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 <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the user matching the specified <paramref name=”userID” /> if it exists.

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

Gets the normalized user name for the specified user, as an asynchronous operation.

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 <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the normalized user name for the specified <paramref name=”user” />.

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

Gets the user identifier for the specified user, as an asynchronous operation.

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 <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the identifier for the specified <paramref name=”user” />.

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

Gets the user name for the specified user, as an asynchronous operation.

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 <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the name for the specified <paramref name=”user” />.

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

Sets the given normalized name for the specified user, as an asynchronous operation.

Arguments:
  • user ({TUser}) – The user whose name should be 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 <see cref=”T: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 userName for the specified user, as an asynchronous operation.

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 <see cref=”T: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 user in the user store, as an asynchronous operation.

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.AspNet.Identity.IdentityResult}

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, containing the <see cref=”T:Microsoft.AspNet.Identity.IdentityResult” /> of the update operation.

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