1 namespace System.Web.Mvc {
2 using System.Collections.Generic;
3 using System.ComponentModel.DataAnnotations;
5 public class StringLengthAttributeAdapter : DataAnnotationsModelValidator<StringLengthAttribute> {
6 public StringLengthAttributeAdapter(ModelMetadata metadata, ControllerContext context, StringLengthAttribute attribute)
7 : base(metadata, context, attribute) {
10 public override IEnumerable<ModelClientValidationRule> GetClientValidationRules() {
11 return new[] { new ModelClientValidationStringLengthRule(ErrorMessage, Attribute.MinimumLength, Attribute.MaximumLength) };