internal void AddValidator(System.Type entityType, IValidatableSubElementsInspector inspector) { IClassValidator cv = GetClassValidator(entityType); var element = new ValidatableElement(entityType, cv); if (inspector != null) { inspector.Inspect(element); } AddValidatableElement(element); }
/// <summary> /// Add a validator to the engine or override existing one. /// </summary> /// <typeparam name="T">The type of an entity.</typeparam> /// <param name="inspector">Inspector for sub-elements</param> public virtual void AddValidator <T>(IValidatableSubElementsInspector inspector) { AddValidator(typeof(T), inspector); }