I have a code below, it connects asp.net to gremlin. But every time I create a service, I continue to create like this code. Is there a way to create a separate file and then just call a function called this connection? Like the sql server side. I tried by creating json file. Then configure it to call it on, but I can't do it. And the code below, it has not yet optimized connection, because every time I turn off the computer, the data is lost and it is not saved. Because it can't call that database name. Is there any way? Give me the sample code. Thanks .
public class ProjectService : IProjectService
{
private readonly GremlinClient _client;
private readonly GraphTraversalSource _g;
public ProjectService()
{
_client = new GremlinClient(new GremlinServer(GremlinDBContext.HOST_NAME, GremlinDBContext.PORT));
_g = Traversal().WithRemote(new DriverRemoteConnection(_client));
}
}