Class ExtendedUserValidator<TUser>
Inherited Members
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class ExtendedUserValidator<TUser> : UserValidator<TUser>, IUserValidator<TUser> where TUser : class, IUser
Type Parameters
TUser
|
Constructors
ExtendedUserValidator(IOptionsSnapshot<TenantIdentityOptions>, ExtendedIdentityErrorDescriber)
Declaration
public ExtendedUserValidator(IOptionsSnapshot<TenantIdentityOptions> tenantIdentityOptionsAccessor, ExtendedIdentityErrorDescriber errors = null)
Parameters
IOptionsSnapshot<TenantIdentityOptions>
tenantIdentityOptionsAccessor
The accessor used to acces the TenantIdentityOptions. |
ExtendedIdentityErrorDescriber
errors
The ExtendedIdentityErrorDescriber used to provider error messages. |
Properties
Describer
Gets the ExtendedIdentityErrorDescriber used to provider error messages for the current ExtendedUserValidator<TUser>.
Declaration
public ExtendedIdentityErrorDescriber Describer { get; }
Property Value
ExtendedIdentityErrorDescriber
The ExtendedIdentityErrorDescriber used to provider error messages for the current ExtendedUserValidator<TUser>. |
TenantIdentityOptions
Gets the TenantIdentityOptions
Declaration
protected TenantIdentityOptions TenantIdentityOptions { get; }
Property Value
TenantIdentityOptions
|
Methods
ValidateAsync(UserManager<TUser>, TUser)
Declaration
public override async Task<IdentityResult> ValidateAsync(UserManager<TUser> manager, TUser user)
Parameters
UserManager<TUser>
manager
|
TUser
user
|
Returns
System.Threading.Tasks.Task<IdentityResult>
|
Overrides
ValidateEmail(ExtendedUserManager<TUser>, TUser, List<IdentityError>)
Validates that the Email is correct for TUser
.
Declaration
protected virtual async Task ValidateEmail(ExtendedUserManager<TUser> manager, TUser user, List<IdentityError> errors)
Parameters
ExtendedUserManager<TUser>
manager
The ExtendedUserManager<TUser> that can be used to retrieve user properties. |
TUser
user
The user to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The current errors, List<T> |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidatePhone(UserManager<TUser>, TUser, ICollection<IdentityError>)
Validates that the PhoneNumber are correct for TUser
.
Declaration
protected async Task ValidatePhone(UserManager<TUser> manager, TUser user, ICollection<IdentityError> errors)
Parameters
UserManager<TUser>
manager
The UserManager<TUser> that can be used to retrieve user properties. |
TUser
user
The user. |
System.Collections.Generic.ICollection<Microsoft.AspNetCore.Identity.IdentityError>
errors
A collection of Microsoft.AspNetCore.Identity.IdentityError used to return error messages. |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidateUniqueEmail(ExtendedUserManager<TUser>, String, TUser, List<IdentityError>)
Validates that the Email is unique for TUser
.
Declaration
protected virtual async Task ValidateUniqueEmail(ExtendedUserManager<TUser> manager, string email, TUser user, List<IdentityError> errors)
Parameters
ExtendedUserManager<TUser>
manager
The ExtendedUserManager<TUser> that can be used to retrieve user properties. |
String
email
The email. |
TUser
user
The user to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The current errors, List<T> |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidateUniqueUserName(ExtendedUserManager<TUser>, String, TUser, List<IdentityError>)
Validates that the UserName is unique for TUser
.
Declaration
protected virtual async Task ValidateUniqueUserName(ExtendedUserManager<TUser> manager, string userName, TUser user, List<IdentityError> errors)
Parameters
ExtendedUserManager<TUser>
manager
The ExtendedUserManager<TUser> that can be used to retrieve user properties. |
String
userName
The user name. |
TUser
user
The user to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The current errors, List<T> |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidateUserName(ExtendedUserManager<TUser>, TUser, List<IdentityError>)
Validates that the UserName is correct for TUser
.
Declaration
protected virtual async Task ValidateUserName(ExtendedUserManager<TUser> manager, TUser user, List<IdentityError> errors)
Parameters
ExtendedUserManager<TUser>
manager
The ExtendedUserManager<TUser> that can be used to retrieve user properties. |
TUser
user
The user to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The current errors, List<T> |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidateUsernameKind(ExtendedUserManager<TUser>, String, TUser, List<IdentityError>)
Validates that the UserName has the correct UsernameKind for TUser
.
Declaration
protected virtual bool ValidateUsernameKind(ExtendedUserManager<TUser> manager, string userName, TUser user, List<IdentityError> errors)
Parameters
ExtendedUserManager<TUser>
manager
The ExtendedUserManager<TUser> that can be used to retrieve user properties. |
String
userName
The user name. |
TUser
user
The user to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The current errors, List<T> |
Returns
Boolean
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidateValid(UserManager<TUser>, IValidUser, ICollection<IdentityError>)
Validates that the ValidFrom and ValidTo are correct for IValidUser.
Declaration
protected Task ValidateValid(UserManager<TUser> manager, IValidUser user, ICollection<IdentityError> errors)
Parameters
UserManager<TUser>
manager
The UserManager<TUser> that can be used to retrieve user properties. |
IValidUser
user
The user that implements IValidUser. |
System.Collections.Generic.ICollection<Microsoft.AspNetCore.Identity.IdentityError>
errors
A collection of Microsoft.AspNetCore.Identity.IdentityError used to return error messages. |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |