From e07d0a65f72082063bbaaf43454fd5b50cf38b4a Mon Sep 17 00:00:00 2001 From: Sam Hard Date: Tue, 2 Jul 2019 16:03:33 -0500 Subject: [PATCH] Add support for local Cosmos DB emulator Fixes issue evo-terren#58 by adding two optional parameters for Port and UseSSL to the constructor of the GraphClient class. --- src/Gremlin.Net.CosmosDb/GraphClient.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Gremlin.Net.CosmosDb/GraphClient.cs b/src/Gremlin.Net.CosmosDb/GraphClient.cs index 3b17182..68881a0 100644 --- a/src/Gremlin.Net.CosmosDb/GraphClient.cs +++ b/src/Gremlin.Net.CosmosDb/GraphClient.cs @@ -1,9 +1,9 @@ -using Gremlin.Net.CosmosDb.Serialization; +using System; +using System.Threading.Tasks; +using Gremlin.Net.CosmosDb.Serialization; using Gremlin.Net.CosmosDb.Structure; using Gremlin.Net.Driver; using Newtonsoft.Json.Linq; -using System; -using System.Threading.Tasks; namespace Gremlin.Net.CosmosDb { @@ -25,9 +25,10 @@ public class GraphClient : IGraphClient, IDisposable /// Name of the database (case-sensitive). /// Name of the graph. /// The access key. - public GraphClient(string gremlinHostname, string databaseName, string graphName, string accessKey) + public GraphClient(string gremlinHostname, string databaseName, string graphName, string accessKey, + int port = 443, bool useSSL = true) { - var server = new GremlinServer(gremlinHostname, 443, true, $"/dbs/{databaseName}/colls/{graphName}", accessKey); + var server = new GremlinServer(gremlinHostname, port, useSSL, $"/dbs/{databaseName}/colls/{graphName}", accessKey); _gremlinClient = new GremlinClient(server, new GraphSONJTokenReader(), mimeType: GremlinClient.GraphSON2MimeType); }