Last active
November 2, 2020 12:00
-
-
Save PradeepLoganathan/b65bd38eeb9bd1dc622d8fa075f9437e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CosmosDbConnection | |
{ | |
private const string EndpointUri = "https://localhost:8081"; | |
private const string PrimaryKey = "yourprimarykey=="; | |
private static CosmosClient _instance = null; | |
private static readonly CosmosClientOptions CosmosClientOptions = new CosmosClientOptions() | |
{ | |
ConnectionMode = ConnectionMode.Direct, | |
ApplicationName = "CosmosStarter" | |
}; | |
public static CosmosClient Instance => _instance ??= new CosmosClient(EndpointUri, PrimaryKey, CosmosClientOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment