Browse Source

changed AddTransient to AddScoped when adding HttpClientFactoryRestClientProvider as a service in the AddScopedDiscordRestClient to stay consistent. AddScopedDiscordRestClient adds scoped services, AddTransientDiscordRestClient adds transient services.

pull/1806/head
emorell96 4 years ago
parent
commit
67ace364a4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Rest/Extensions/ServiceCollectionExtensions.cs

+ 1
- 1
src/Discord.Net.Rest/Extensions/ServiceCollectionExtensions.cs View File

@@ -28,7 +28,7 @@ namespace Discord.Rest.Extensions



services.AddTransient<HttpClientFactoryRestClientProvider>(provider => new HttpClientFactoryRestClientProvider(provider.GetRequiredService<IHttpClientFactory>()));
services.AddScoped<HttpClientFactoryRestClientProvider>(provider => new HttpClientFactoryRestClientProvider(provider.GetRequiredService<IHttpClientFactory>()));
services.AddScoped<DiscordRestClient>(provider =>
{
var config = new DiscordRestConfig


Loading…
Cancel
Save