public static Boolean CheckRuleIsValid(Rule ruleToEval, ObjectInstance oi, out RuleViolation violatedRule) { try { if (CheckCondition(ruleToEval.Condition, oi)) { if (ruleToEval.Assertion(oi) != true) { violatedRule = new RuleViolation(ruleToEval, oi); return(false); } else { violatedRule = null; return(true); } } violatedRule = null; return(true); } catch (Exception ex) { violatedRule = new RuleViolationFromException(ruleToEval, oi, ex); return(false); } }
public static Boolean CheckRuleIsValid(Rule ruleToEval, ObjectInstance oi, out RuleViolation violatedRule) { try { if (CheckCondition(ruleToEval.Condition, oi)) { if (ruleToEval.Assertion(oi) != true) { violatedRule = new RuleViolation(ruleToEval, oi); return false; } else { violatedRule = null; return true; } } violatedRule = null; return true; } catch(Exception ex) { violatedRule = new RuleViolationFromException(ruleToEval, oi, ex); return false; } }
internal Boolean Validate(ObjectInstance oi, out RuleViolation ruleViolation) { ruleViolation = GetFirstRuleViolation(oi); return(ruleViolation == null); }
internal Boolean Validate(ObjectInstance oi, out RuleViolation ruleViolation) { ruleViolation = GetFirstRuleViolation(oi); return ruleViolation == null; }