public static IReadOnlyDictionary <string, List <object> > ToMultiValuedDictionary(this ResultSet resultSet) { resultSet.EnsureSuccess(); var result = resultSet.GetSingleResult(); result.EnsureSuccess(); var firstSeries = result.GetSingleSeries(); return(firstSeries.ToMultiValuedDictionary()); }
public static object[] ToSimpleList(this ResultSet resultSet) { resultSet.EnsureSuccess(); var result = resultSet.GetSingleResult(); result.EnsureSuccess(); var firstSeries = result.GetSingleSeries(); return(firstSeries.ToSimpleDictionary().Select(x => x.Value).ToArray()); }
private static Result GetSingleResult(this ResultSet resultSet) { Result result; resultSet.EnsureSuccess(); try { result = resultSet.Results.SingleOrDefault(); if (result == null) { throw new InfluxException("ResultSet did not contain any Results"); } } catch (InvalidOperationException ioe) { throw new InfluxException("ResultSet contained an unexpected number of Results", ioe); } result.EnsureSuccess(); return(result); }
public static string[] ToSimpleStringList(this ResultSet resultSet) { resultSet.EnsureSuccess(); return(resultSet.ToSimpleList().Select(x => x.ToString()).ToArray()); }