Last active
September 21, 2020 17:14
-
-
Save ealsur/d435fe063469fe09235e6d9e9eb81315 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddHttpClient(); | |
services.AddSingleton<CosmosClient>(serviceProvider => | |
{ | |
IHttpClientFactory httpClientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>(); | |
CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() | |
{ | |
HttpClientFactory = httpClientFactory.CreateClient, | |
ConnectionMode = ConnectionMode.Gateway | |
}; | |
return new CosmosClient("<connection-string>", cosmosClientOptions); | |
}); | |
//... other service registration | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ealsur I fixed those lines already an the error is still the same.