public ParseResult <string, object> GetResult() { if (FormatValueCountUnequalToFormatPlaceholderCount) { var result = ParseResult.Error(ValidationErrors.Concat(new[] { $"Format values count ({FormatValues.Count}) is not equal to column placeholders count ({FormatPlaceholders.Count}), see #MISSING# in format placeholders list (keys)" }), FormatPlaceholders.Zip(FormatValues, (name, value) => new KeyValuePair <string, object>(name, value))); FormatPlaceholders.AddRange(Enumerable.Range(1, FormatValues.Count - FormatPlaceholders.Count).Select(_ => "#MISSING#")); return(result); } else if (FormatPlaceholderCountUnequalToFormatValueCount) { var result = ParseResult.Error(ValidationErrors.Concat(new[] { $"Format placeholders count ({FormatPlaceholders.Count}) is not equal to column values count ({FormatValues.Count}), see #MISSING# in format values list (values)" }), FormatPlaceholders.Zip(FormatValues, (name, value) => new KeyValuePair <string, object>(name, value))); FormatValues.AddRange(Enumerable.Range(1, FormatPlaceholders.Count - FormatValues.Count).Select(_ => "#MISSING#")); return(result); } else if (FormatPlaceholders.Count == 0) { return(ParseResult.Error(ValidationErrors.Concat(new[] { "No format placeholders were found" }), Array.Empty <KeyValuePair <string, object> >())); } return(ParseResult.Create(ValidationErrors.Count == 0, FormatPlaceholders.Zip(FormatValues, (name, value) => new KeyValuePair <string, object>(name, value)), ValidationErrors)); }