예제 #1
0
        public static Dictionary <string, ValidationModel> Create()
        {
            Dictionary <string, ValidationModel> result = new Dictionary <string, ValidationModel>();

            foreach (DataRow dataModel in chocoReader.LoadDatasetFromXml(fileName).Tables[tableName].Rows)
            {
                ValidationModel validationModel = new ValidationModel();
                validationModel.EmailRegex   = new Regex(dataModel[regexp].ToString());
                validationModel.ErrorMessage = dataModel[errorMessage].ToString();

                result.Add(dataModel[fieldId].ToString(), validationModel);
            }

            return(result);
        }
예제 #2
0
        public static Dictionary<string, ValidationModel> Create()
        {
            Dictionary<string, ValidationModel> result = new Dictionary<string, ValidationModel>();

            foreach (DataRow dataModel in chocoReader.LoadDatasetFromXml(fileName).Tables[tableName].Rows)
            {
                ValidationModel validationModel = new ValidationModel();
                validationModel.EmailRegex = new Regex(dataModel[regexp].ToString());
                validationModel.ErrorMessage = dataModel[errorMessage].ToString();

                result.Add(dataModel[fieldId].ToString(), validationModel);
            }

            return result;
        }