Table of Contents

Class AssetSelectorValidationRule

Namespace
Kentico.Xperience.Admin.Base.Forms
Assembly
Kentico.Xperience.Admin.Base.dll

Validation rule checking asset existence in Media library designed for AssetSelectorComponent.

public sealed class AssetSelectorValidationRule : ValidationRule<AssetSelectorValidationRuleProperties, AssetSelectorValidationRuleClientProperties, IEnumerable<AssetRelatedItem>>, IValidationRule
Inheritance
object
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 ILocalizationService

Localization 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 AssetSelectorValidationRuleClientProperties

Current 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.