private static RulesCheckerResult MergeResults(RulesCheckerResult results1, RulesCheckerResult results2) { var hasConfidentielle = results1.HasConfidentielle || results2.HasConfidentielle; var hasDivisionParZero = results1.HasDivisionParZero || results2.HasDivisionParZero; var hasManquante = results1.HasManquante || results2.HasManquante; var hasNonDiffusable = results1.HasNonDiffusable || results2.HasNonDiffusable; return(new RulesCheckerResult(hasConfidentielle, hasNonDiffusable, hasDivisionParZero, hasManquante)); }
public static RulesCheckerResult Check(object data, Expression expression) { if (IsIEnumerable(data)) { var result = new RulesCheckerResult(false, false, false, false); IEnumerable dataItems = (IEnumerable)data; foreach (object dataItem in dataItems) { result = MergeResults(result, GetResults(dataItem, expression)); } return(result); } else { return(GetResults(data, expression)); } }