Class AssetSelectorValidationRule
Validation rule checking asset existence in Media library designed for AssetSelectorComponent.
public sealed class AssetSelectorValidationRule : ValidationRule<AssetSelectorValidationRuleProperties, AssetSelectorValidationRuleClientProperties, IEnumerable<AssetRelatedItem>>, IValidationRule
- Inheritance
-
objectValidationRule<AssetSelectorValidationRuleProperties, AssetSelectorValidationRuleClientProperties, IEnumerable<AssetRelatedItem>>AssetSelectorValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
AssetSelectorValidationRule(Func<IEnumerable<AssetRelatedItem>>, ILocalizationService)
Initializes a new instance of AssetSelectorValidationRule.
public AssetSelectorValidationRule(Func<IEnumerable<AssetRelatedItem>> valueProvider, ILocalizationService localizationService)
Parameters
valueProvider
Func<IEnumerable<AssetRelatedItem>>Delegate to provide component value.
localizationService
ILocalizationServiceLocalization service.
Properties
ClientRuleName
Gets the client rule name identifier.
public override string ClientRuleName { get; }
Property Value
- string
Methods
ConfigureClientProperties(AssetSelectorValidationRuleClientProperties)
Allows set validation rule client properties.
protected override Task ConfigureClientProperties(AssetSelectorValidationRuleClientProperties clientProperties)
Parameters
clientProperties
AssetSelectorValidationRuleClientPropertiesCurrent instance of client properties.
Returns
- Task
Validate(IEnumerable<AssetRelatedItem>, IFormFieldValueProvider)
Validates value
and returns the validation result.
public override Task<ValidationResult> Validate(IEnumerable<AssetRelatedItem> value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
IEnumerable<AssetRelatedItem>formFieldValueProvider
IFormFieldValueProvider
Returns
- Task<ValidationResult>
Remarks
Checks that all assets retrieved by identifier exist in database.