Class PersonValidator<TPerson>
Provides validation services for person classes.
Inherited Members
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class PersonValidator<TPerson> : IPersonValidator<TPerson> where TPerson : class, IPerson
Type Parameters
TPerson
The type encapsulating a person. |
Constructors
PersonValidator(IOrganisationManager, ExtendedIdentityErrorDescriber)
Creates a new instance of PersonValidator<TPerson>/
Declaration
public PersonValidator(IOrganisationManager organisationManager, ExtendedIdentityErrorDescriber errors = null)
Parameters
IOrganisationManager
organisationManager
API for managing organisations in a persistant store. |
ExtendedIdentityErrorDescriber
errors
The Microsoft.AspNetCore.Identity.IdentityErrorDescriber used to provider error messages. |
Properties
Describer
Gets the Microsoft.AspNetCore.Identity.IdentityErrorDescriber used to provider error messages for the current PersonValidator<TPerson>.
Declaration
protected ExtendedIdentityErrorDescriber Describer { get; }
Property Value
ExtendedIdentityErrorDescriber
The Microsoft.AspNetCore.Identity.IdentityErrorDescriber used to provider error messages for the current PersonValidator<TPerson>. |
OrganisationManager
Gets the IOrganisationManager.
Declaration
protected IOrganisationManager OrganisationManager { get; }
Property Value
IOrganisationManager
|
Methods
ValidateAsync(PersonManager<TPerson>, TPerson)
Validates the specified person
as an asynchronous operation.
Declaration
public virtual async Task<IdentityResult> ValidateAsync(PersonManager<TPerson> manager, TPerson person)
Parameters
PersonManager<TPerson>
manager
The PersonManager<TPerson> that can be used to retrieve person properties. |
TPerson
person
The person to validate. |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the validation operation. |
Implements
ValidateOrganisation(TPerson, List<IdentityError>)
Validates that the organisation for the specified person
is valid as an asynchronous operation.
Declaration
protected virtual async Task ValidateOrganisation(TPerson person, List<IdentityError> errors)
Parameters
TPerson
person
The person to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The list of identity errors to fill if email is not unique. |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |
ValidateUniqueEmail(PersonManager<TPerson>, TPerson, List<IdentityError>)
Validates that the email address for the specified person
is unique as an asynchronous operation.
Declaration
protected virtual async Task ValidateUniqueEmail(PersonManager<TPerson> manager, TPerson person, List<IdentityError> errors)
Parameters
PersonManager<TPerson>
manager
The PersonManager<TPerson> that can be used to retrieve person properties. |
TPerson
person
The person to validate. |
List<Microsoft.AspNetCore.Identity.IdentityError>
errors
The list of identity errors to fill if email is not unique. |
Returns
System.Threading.Tasks.Task
The System.Threading.Tasks.Task that represents the asynchronous operation. |