1 namespace System.Web.ModelBinding {
2 using System.ComponentModel.DataAnnotations;
4 public sealed class RangeAttributeAdapter : DataAnnotationsModelValidator<RangeAttribute> {
5 public RangeAttributeAdapter(ModelMetadata metadata, ModelBindingExecutionContext context, RangeAttribute attribute)
6 : base(metadata, context, attribute) {
10 public override IEnumerable<ModelClientValidationRule> GetClientValidationRules() {
11 string errorMessage = ErrorMessage; // Per Dev10 Bug #923283, need to make sure ErrorMessage is called before Minimum/Maximum
12 return new[] { new ModelClientValidationRangeRule(errorMessage, Attribute.Minimum, Attribute.Maximum) };