public void AddSinglePropertyRule(string property, IRule rule) { if (property.Equals(nameof(HasErrors))) return; if (property.Equals(nameof(ErrorLevel))) return; if (_RuleMap.ContainsKey(property)) { _RuleMap[property].AddRule(rule); } else { Validation.PropertyRule r = new Validation.PropertyRule(rule); _RuleMap.Add(property, r); } }
public void AddMultiPropertyRule(List<string> properties, IRule rule) { foreach (string prop in properties) { if (prop.Equals(nameof(HasErrors))) continue; if (prop.Equals(nameof(ErrorLevel))) continue; if (_RuleMap.ContainsKey(prop)) { _RuleMap[prop].AddRule(rule); } else { Validation.PropertyRule r = new Validation.PropertyRule(rule); _RuleMap.Add(prop, r); } } }