コード例 #1
0
        private static IParsingResultsDictionary handleErrorsWithFunction(ParsingResultsErrorBehavior errorBehavior, IParsingResultsDictionary resultsDictionary, Action <IEnumerable <Exception> > errorFunction)
        {
            switch (errorBehavior)
            {
            case ParsingResultsErrorBehavior.OnFirstError:
                errorFunction(resultsDictionary.Errors.First().AsEnumerable().ToList());
                break;

            case ParsingResultsErrorBehavior.Aggregate:
                errorFunction(resultsDictionary.Errors.ToList());
                break;
            }

            return(ParsingResultsDictionary.CreateFailed(resultsDictionary.Errors.ToList()));
        }
コード例 #2
0
 public IParsingResultsDictionary GetResults()
 => _exceptions.Any()
         ? ParsingResultsDictionary.CreateFailed(_exceptions)
         : ParsingResultsDictionary.CreateSuccessful(_internalDict);