A GraphTraversalSource from Gremlin.NET can be used (and reused) to build traversals.

var traversal = g.V().HasLabel("person").Values<string>("name");

Use the ExecuteGraph() extension methods to execute a traversal:

GraphResultSet result = session.ExecuteGraph(traversal);

Or the async counterpart:

GraphResultSet result = await session.ExecuteGraphAsync(traversal);

Alternatively, Traversals can be executed on the server using the methods that represent Gremlin terminal steps. In the case of Gremlin.Net variant, those are ToList(), ToSet(), Next(), NextTraverser() and Iterate(), along with Promise() for async traversal execution.

List<string> names = traversal.ToList();

Wrapping Up

The documentation for the DataStax C# Driver Fluent API for DSE Graph is located here.

Your feedback is important to us, you can use the following channels to send comments or questions: