/// <summary>
        /// Creates an initialized <see cref="IGraphStatement"/> from a <c>GraphTraversal</c> to use directly with a
        /// <see cref="ISession"/>.
        /// <para>
        /// Note that the <c>IGraphStatement</c> will use the default <c>GraphOptions</c> at cluster level and not the
        /// ones defined on the <c>GraphTraversalSource</c>.
        /// </para>
        /// </summary>
        public static IGraphStatement StatementFromTraversal(ITraversal traversal)
        {
            if (traversal == null)
            {
                throw new ArgumentNullException(nameof(traversal));
            }

            return(DseRemoteConnection.CreateStatement(traversal.Bytecode, null, false));
        }
        public IGraphStatement ToGraphStatement()
        {
            if (_list.Count == 0)
            {
                throw new InvalidOperationException("Batch does not contain traversals");
            }

            return(DseRemoteConnection.CreateStatement(_list.Select(t => t.Bytecode), _options, false));
        }
Exemple #3
0
        public async Task <ITraversal <TStart, TEnd> > SubmitAsync <TStart, TEnd>(Bytecode bytecode)
        {
            var graphStatement = DseRemoteConnection.CreateStatement(bytecode, _graphOptions, true);
            var rs             = await _session.ExecuteGraphAsync(graphStatement).ConfigureAwait(false);

            var graphTraversal = new GraphTraversal <TStart, TEnd>
            {
                Traversers = GetTraversers <TEnd>(rs)
            };

            return(graphTraversal);
        }