You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the ability to register Refit clients as keyed services (#1981)
* Add the ability to register Refit clients as keyed services
* Ensure that we have a HttpClient per service key
This can be achieved by adding `$";{serviceKey}"` to the `httpClientName`
* Second take to fix the HTTP client name
* Better output
@@ -91,6 +127,60 @@ public static IHttpClientBuilder AddRefitClient<T>(
91
127
);
92
128
}
93
129
130
+
/// <summary>
131
+
/// Adds a Refit client to the DI container with a specified service key
132
+
/// </summary>
133
+
/// <typeparam name="T">Type of the Refit interface</typeparam>
134
+
/// <param name="services">container</param>
135
+
/// <param name="serviceKey">An optional key to associate with the specific Refit client instance</param>
136
+
/// <param name="settingsAction">Optional. Action to configure refit settings. This method is called once and only once, avoid using any scoped dependencies that maybe be disposed automatically.</param>
137
+
/// <param name="httpClientName">Optional. Allows users to change the HttpClient name as provided to IServiceCollection.AddHttpClient. Useful for logging scenarios.</param>
@@ -158,6 +248,78 @@ public static IHttpClientBuilder AddRefitClient(
158
248
);
159
249
}
160
250
251
+
/// <summary>
252
+
/// Adds a Refit client to the DI container with a specified service key
253
+
/// </summary>
254
+
/// <param name="services">container</param>
255
+
/// <param name="refitInterfaceType">Type of the Refit interface</param>
256
+
/// <param name="serviceKey">An optional key to associate with the specific Refit client instance</param>
257
+
/// <param name="settingsAction">Optional. Action to configure refit settings. This method is called once and only once, avoid using any scoped dependencies that maybe be disposed automatically.</param>
258
+
/// <param name="httpClientName">Optional. Allows users to change the HttpClient name as provided to IServiceCollection.AddHttpClient. Useful for logging scenarios.</param>
0 commit comments