Exemplo n.º 1
0
        private async Task PrintResult(GremlinQuery q1, bool outputResult = true, bool execute = true)
        {
            _output.WriteLine($"query: {q1}");
            if (execute)
            {
                var t      = Stopwatch.StartNew();
                var result = await q1.ExecuteAsync();

                t.Stop();
                if (outputResult)
                {
                    _output.WriteLine($"result accuired in {t.ElapsedMilliseconds}ms:");
                    _output.WriteLine(JsonConvert.SerializeObject(result));
                }
            }
            _output.WriteLine("");
        }
Exemplo n.º 2
0
        public async Task <IEnumerable <T> > VAsync <T>(GremlinQuery g) where T : IVertex
        {
            var v = await g.ExecuteAsync();

            return(v.Select(d => GetItemValue <T>((object)d)).ToList());
        }