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]); } } }
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]); } } }