diff --git a/samples/05_simple_blazor_discord_login/Startup.cs b/samples/05_simple_blazor_discord_login/Startup.cs index 15a9c6143..ad70a529a 100644 --- a/samples/05_simple_blazor_discord_login/Startup.cs +++ b/samples/05_simple_blazor_discord_login/Startup.cs @@ -30,7 +30,7 @@ namespace _04_simple_blazor_discord_login services.AddRazorPages(); services.AddServerSideBlazor(); services.AddSingleton(); - services.AddScopedDiscordRestClient(); + services.AddDiscordRestClient(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/src/Discord.Net.Rest/Net/HttpClientFactoryClientProvider.cs b/src/Discord.Net.Rest/Net/HttpClientFactoryClientProvider.cs deleted file mode 100644 index 728eed3a0..000000000 --- a/src/Discord.Net.Rest/Net/HttpClientFactoryClientProvider.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Discord.Net.Rest; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; - -namespace Discord.Rest.Net -{ - /// - /// This RestClientProvider creates the IRestClient used when using an IHttpClientFactory. - /// - public class HttpClientFactoryRestClientProvider - { - public readonly RestClientProvider Instance; - - private readonly IHttpClientFactory _httpClientFactory; - - /// - /// Constructs the HttpClientFactoryRestClientProvider, the idea is to use this with DI so that the parameters gets fed with the right HttpClientFactory. - /// - /// This is the IHttpClientFactory used. It should be fed through DI. - public HttpClientFactoryRestClientProvider(IHttpClientFactory httpClientFactory) - { - _httpClientFactory = httpClientFactory; - - Instance = url => new HttpClientFactoryRestClient(url, _httpClientFactory.CreateClient("HttpClientFactoryRestClientProvider"), useProxy: false); - } - - - - } -}