有扩展功能异步提交查询在Gremlin.Net,有些人会string
被建议不要和其他人使用RequestMessage
这是不一样可读性使用GraphTraversal
功能。
有没有办法异步提交像下面这样的查询,而不提交字符串或RequestMessage
?
var res = _graphTraversalSource.V().Has("name", "Armin").Out().Values<string>("name").ToList();
Run Code Online (Sandbox Code Playgroud)
我正在编写一个查询 AWS Neptune 的 API。以下是我得到GraphTraversalSource
的单服务的构造函数(不知道我是否应该做RemoteConnection
一个单身,并生成一个GraphTraversalSource
为每个查询或这是正确的做法):
private readonly GraphTraversalSource _graphTraversalSource;
public NeptuneHandler(string endpoint, int port)
{
var gremlinClient = new GremlinClient(new GremlinServer(endpoint, port));
var remoteConnection = new DriverRemoteConnection(gremlinClient);
_graphTraversalSource = AnonymousTraversalSource.Traversal().WithRemote(remoteConnection);
}
Run Code Online (Sandbox Code Playgroud)