/// <summary>
        /// 
        /// </summary>
        /// <param name="metadata"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
        {
            var error   = FormatErrorMessage(metadata.DisplayName);
            var rule    = new ModelClientValidationRemoteRule(error, GetUrl(context), HttpMethod, FormatAdditionalFieldsForClientValidation(metadata.PropertyName));

            yield return rule;
        }
예제 #2
0
        public static ModelClientValidationRule Remote(string url, string errorMessage = "", string httpMethod = "POST")
        {
            ModelClientValidationRemoteRule clientValidationRule = new ModelClientValidationRemoteRule(errorMessage, url, httpMethod, "");

            return clientValidationRule;
        }
        public static ModelClientValidationRule Remote(string url, string errorMessage = "", string httpMethod = "POST")
        {
            ModelClientValidationRemoteRule clientValidationRule = new ModelClientValidationRemoteRule(errorMessage, url, httpMethod, "");

            return(clientValidationRule);
        }