namespace System.Web.ModelBinding { using System.ComponentModel.DataAnnotations; public sealed class RequiredAttributeAdapter : DataAnnotationsModelValidator { public RequiredAttributeAdapter(ModelMetadata metadata, ModelBindingExecutionContext context, RequiredAttribute attribute) : base(metadata, context, attribute) { } #if UNDEF public override IEnumerable GetClientValidationRules() { return new[] { new ModelClientValidationRequiredRule(ErrorMessage) }; } #endif } }