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())); }
public IParsingResultsDictionary GetResults() => _exceptions.Any() ? ParsingResultsDictionary.CreateFailed(_exceptions) : ParsingResultsDictionary.CreateSuccessful(_internalDict);