public IEnumerable <ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
        {
            ErrorMessage = UmbracoValidationHelper.GetPropertyValue(_propertyAlias);

            var error = FormatErrorMessage(metadata.DisplayName);
            var rule  = new ModelClientValidationStringLengthRule(error, _minimumLength, _maximumLength);

            yield return(rule);
        }
        public IEnumerable <ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
        {
            ErrorMessage = UmbracoValidationHelper.GetPropertyValue(_propertyAlias);
            var error = FormatErrorMessage(metadata.DisplayName);
            var rule  = new ModelClientValidationRule
            {
                ErrorMessage   = error,
                ValidationType = "email"
            };

            yield return(rule);
        }