Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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;
   }
 }
Exemplo n.º 3
0
 internal Boolean Validate(ObjectInstance oi, out RuleViolation ruleViolation)
 {
     ruleViolation = GetFirstRuleViolation(oi);
     return(ruleViolation == null);
 }
Exemplo n.º 4
0
    internal Boolean Validate(ObjectInstance oi, out RuleViolation ruleViolation)
    {

      ruleViolation = GetFirstRuleViolation(oi);
      return ruleViolation == null;
    }