Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        public static string[] ToSimpleStringList(this ResultSet resultSet)
        {
            resultSet.EnsureSuccess();

            return(resultSet.ToSimpleList().Select(x => x.ToString()).ToArray());
        }