UserValidator Class

Summary

Provides validation services for user classes.

Syntax

public class UserValidator : IUserValidator

GitHub

View on GitHub

class Microsoft.AspNet.Identity.UserValidator

Constructors

UserValidator(Microsoft.AspNet.Identity.IdentityErrorDescriber)

Creates a new instance of UserValidator<TUser>/

Arguments:
  • errors (Microsoft.AspNet.Identity.IdentityErrorDescriber) – The Microsoft.AspNet.Identity.IdentityErrorDescriber used to provider error messages.
public UserValidator(IdentityErrorDescriber errors = null)

Properties

Describer()

Gets the Microsoft.AspNet.Identity.IdentityErrorDescriber used to provider error messages for the current UserValidator<TUser>.

Return type:Microsoft.AspNet.Identity.IdentityErrorDescriber
public IdentityErrorDescriber Describer { get; }

Methods

ValidateAsync<TUser>(Microsoft.AspNet.Identity.UserManager<TUser>, TUser)

Validates the specified user as an asynchronous operation.

Arguments:
  • manager (Microsoft.AspNet.Identity.UserManager{{TUser}}) – The Microsoft.AspNet.Identity.UserManager`1 that can be used to retrieve user properties.
  • user ({TUser}) – The user to validate.
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 validation operation.

public virtual Task<IdentityResult> ValidateAsync<TUser>(UserManager<TUser> manager, TUser user)where TUser : class