Class ContentItemAssetExtensionValidationRule
Validation rule for extension validation in the file uploaded using ContentItemFileUploaderComponent.
public sealed class ContentItemAssetExtensionValidationRule : ValidationRule<ContentItemAssetExtensionValidationRuleProperties, ContentItemAssetExtensionValidationRuleClientProperties, ContentItemAssetMetadata>, IValidationRule
- Inheritance
-
objectValidationRule<ContentItemAssetExtensionValidationRuleProperties, ContentItemAssetExtensionValidationRuleClientProperties, ContentItemAssetMetadata>ContentItemAssetExtensionValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
ContentItemAssetExtensionValidationRule(Func<ContentItemAssetMetadata>, ILocalizationService)
Initializes a new instance of ContentItemAssetExtensionValidationRule.
public ContentItemAssetExtensionValidationRule(Func<ContentItemAssetMetadata> valueProvider, ILocalizationService localizationService)
Parameters
valueProvider
Func<ContentItemAssetMetadata>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(ContentItemAssetExtensionValidationRuleClientProperties)
Allows set validation rule client properties.
protected override Task ConfigureClientProperties(ContentItemAssetExtensionValidationRuleClientProperties clientProperties)
Parameters
clientProperties
ContentItemAssetExtensionValidationRuleClientPropertiesCurrent instance of client properties.
Returns
- Task
Validate(ContentItemAssetMetadata, IFormFieldValueProvider)
Validates value
and returns the validation result.
public override Task<ValidationResult> Validate(ContentItemAssetMetadata value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
ContentItemAssetMetadataValue to be validated.
formFieldValueProvider
IFormFieldValueProviderProvider of values of other form fields for contextual validation.
Returns
- Task<ValidationResult>
Returns validation result with IsValid set to true, if value is valid. Otherwise returns result with the flag set to false and a corresponding error message.