From 8137ca1eca1673f02aa0b84cce754f2bc58136c6 Mon Sep 17 00:00:00 2001 From: emorell96 Date: Mon, 22 Mar 2021 01:31:53 -0700 Subject: [PATCH] added documentation to this method. --- .../Extensions/ServiceCollectionExtensions.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Extensions/ServiceCollectionExtensions.cs b/src/Discord.Net.Rest/Extensions/ServiceCollectionExtensions.cs index a45be05a5..6e252fb85 100644 --- a/src/Discord.Net.Rest/Extensions/ServiceCollectionExtensions.cs +++ b/src/Discord.Net.Rest/Extensions/ServiceCollectionExtensions.cs @@ -16,6 +16,12 @@ namespace Discord.Rest.Extensions /// public static class ServiceCollectionExtensions { + /// + /// Adds the DiscordRestClient as a Scoped Service to be able to use through DI. + /// + /// This is the IServiceCollection where all the services are located. + /// Set this to true to use proxies, default is false. + /// public static IServiceCollection AddScopedDiscordRestClient(this IServiceCollection services, bool useProxy = false) { services.AddHttpClient("HttpClientFactoryRestClientProvider") @@ -40,7 +46,12 @@ namespace Discord.Rest.Extensions return services; } - + /// + /// Adds the DiscordRestClient as a Transient Service to be able to use through DI. + /// + /// This is the IServiceCollection where all the services are located. + /// Set this to true to use proxies, default is false. + /// public static IServiceCollection AddTransientDiscordRestClient(this IServiceCollection services, bool useProxy = false) //where should we put this useProxy options, I haven't fully understood where the original code takes this from. { services.AddHttpClient("HttpClientFactoryRestClientProvider")