mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
#18269: Mapping localized data annotation attributes to existing attributes to support client side validation.
Work Item: 18269
This commit is contained in:

committed by
Sipke Schoorstra

parent
a8ff9e218a
commit
7f463d07cc
@@ -16,6 +16,12 @@ namespace Orchard.Mvc.DataAnnotations {
|
||||
{ typeof(StringLengthAttribute), (attribute, t) => new LocalizedStringLengthAttribute((StringLengthAttribute)attribute, t)},
|
||||
{ typeof(RegularExpressionAttribute), (attribute, t) => new LocalizedRegularExpressionAttribute((RegularExpressionAttribute)attribute, t)}
|
||||
};
|
||||
|
||||
//Register Orchard's localized version of the validation attributes to the existing adapters.
|
||||
RegisterAdapter(typeof(LocalizedRequiredAttribute), typeof(RequiredAttributeAdapter));
|
||||
RegisterAdapter(typeof(LocalizedRangeAttribute), typeof(RangeAttributeAdapter));
|
||||
RegisterAdapter(typeof(LocalizedStringLengthAttribute), typeof(StringLengthAttributeAdapter));
|
||||
RegisterAdapter(typeof(LocalizedRegularExpressionAttribute), typeof(RegularExpressionAttributeAdapter));
|
||||
}
|
||||
|
||||
protected override IEnumerable<ModelValidator> GetValidators(ModelMetadata metadata, ControllerContext context, IEnumerable<Attribute> attributes) {
|
||||
|
Reference in New Issue
Block a user