Show / Hide Table of Contents

Class MultitenantPersonValidator<TPerson>

Provides validation services for person classes.

Inheritance
Object
PersonValidator<TPerson>
MultitenantPersonValidator<TPerson>
Inherited Members
PersonValidator<TPerson>.OrganisationManager
PersonValidator<TPerson>.ValidateUniqueEmail(PersonManager<TPerson>, TPerson, List<IdentityError>)
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class MultitenantPersonValidator<TPerson> : PersonValidator<TPerson>, IPersonValidator<TPerson> where TPerson : class, IPerson, IMultitenantEntity
Type Parameters
TPerson

The type encapsulating a person.

Constructors

MultitenantPersonValidator(ITenantAccessor, IOrganisationManager, MultitenantIdentityErrorDescriber)

Declaration
public MultitenantPersonValidator(ITenantAccessor tenantAccessor, IOrganisationManager organisationManager, MultitenantIdentityErrorDescriber errors = null)
Parameters
ITenantAccessor tenantAccessor

The accessor used to access the identity of the current tenant.

IOrganisationManager organisationManager

The IOrganisationManager used to validate that a valid organisation is choosen for the person.

MultitenantIdentityErrorDescriber errors

The MultitenantIdentityErrorDescriber used to provider error messages.

Properties

Describer

Declaration
protected MultitenantIdentityErrorDescriber Describer { get; }
Property Value
MultitenantIdentityErrorDescriber

TenantAccessor

Gets the ITenantAccessor.

Declaration
protected ITenantAccessor TenantAccessor { get; }
Property Value
ITenantAccessor

Methods

SetDefaultOrganisation(TPerson)

Sets a default organisation id for the person if it is missing.

Declaration
protected virtual void SetDefaultOrganisation(TPerson person)
Parameters
TPerson person

The person.

ValidateAsync(PersonManager<TPerson>, TPerson)

Validates the specified person as an asynchronous operation.

Declaration
public override 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.

Overrides
IRM.AspNetCore.Identity.PersonValidator<TPerson>.ValidateAsync(IRM.AspNetCore.Identity.PersonManager<TPerson>, TPerson)

ValidateOrganisation(TPerson, List<IdentityError>)

Validates that the organisation for the specified person is valid as an asynchronous operation.

Declaration
protected override 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.

Overrides
IRM.AspNetCore.Identity.PersonValidator<TPerson>.ValidateOrganisation(TPerson, System.Collections.Generic.List<Microsoft.AspNetCore.Identity.IdentityError>)
Back to top Generated by DocFX