public void AddErrorValidationEvent(ErrorValidationEvent errorEvent)
 {
     if (errorEvent == null)
     {
         emptyTrace = true;
     }
     else
     {
         errorEvents.Add(errorEvent);
     }
 }
Example #2
0
        public FlowErrorTrace Validate(ValidationRequest request)
        {
            FlowErrorTrace flowErrorTrace = new FlowErrorTrace(this);

            foreach (ValidationFlow flow in flows)
            {
                FlowErrorTrace lastFlowTrace = flow.Validate(request);
                flowErrorTrace.AddFlowErrorTrace(lastFlowTrace);
            }
            foreach (ValidationRule rule in rules)
            {
                ErrorValidationEvent validationEvent = rule.Validate(request, flowErrorTrace);
                flowErrorTrace.AddErrorValidationEvent(validationEvent);
            }

            if (flowErrorTrace.containsMajorValidationErrors())
            {
                return(flowErrorTrace);
            }
            else
            {
                return(null);
            }
        }