Source/MarsRover.Web/Attributes/EnsureOneElementAttribute.cs
/// <summary>When implemented in a class, returns client validation rules for that class.</summary>
/// <returns>The client validation rules for this validator.</returns>
/// <param name="metadata">The model metadata.</param>
/// <param name="context">The controller context.</param>
When implemented in a class, returns client validation rules for that class.
When implemented in a class returns client validation rules for that class .
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
        {
            var rule = new ModelClientValidationRule();
            rule.ErrorMessage = this.FormatErrorMessage(metadata.DisplayName);
            rule.ValidationType = "listlength";
            yield return rule;
        }
public IEnumerable < ModelClientValidationRule > GetClientValidationRules ( ModelMetadata metadata , ControllerContext context ) { var rule = new ModelClientValidationRule ( ) ; rule . ErrorMessage = this . FormatErrorMessage ( metadata . DisplayName ) ; rule . ValidationType = " " ; yield return rule ; }
When implemented in a class, returns client validation rules for that class.
When implemented in a class returns client validation rules for that class .
The client validation rules for this validator.
The client validation rules for this validator .
metadata
ModelMetadata
The model metadata.
The model metadata .
context
ControllerContext
The controller context.
The controller context .