private static DocumentClient getClient() { string url = Environment.GetEnvironmentVariable("AZURE_COSMOSDB_SQLDB_URI"); string key = Environment.GetEnvironmentVariable("AZURE_COSMOSDB_SQLDB_KEY"); DocumentClient client = CosmosDBClient.GetInstance(url, key).GetClient(); return(client); }
public static CosmosDBClient GetInstance(string arg1, string arg2) { if (_instance == null) { lock (_mutex) // now I can claim some form of thread safety... { if (_instance == null) { _instance = new CosmosDBClient(arg1, arg2); } } } return(_instance); }