示例#1
0
        public void RemoveRule <TProperty>(Expression <Func <T, TProperty> > expression)
        {
            var propList = NestedValidators.Where(x => (x as PropertyRule).Expression.GetMember() == expression.GetMember()).ToList();

            if (propList != null)
            {
                for (int i = propList.Count() - 1; i >= 0; i--)
                {
                    NestedValidators.Remove(propList[i]);
                }
            }
        }
示例#2
0
        public void RemoveRule(string prop)
        {
            var propList = NestedValidators.Where(x => (x as PropertyRule).PropertyName == prop).ToList();

            if (propList != null)
            {
                for (int i = propList.Count() - 1; i >= 0; i--)
                {
                    NestedValidators.Remove(propList[i]);
                }
            }
        }