From 470902911ea0c22c76392f33952cbd7e2ba9ca38 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Sat, 6 Dec 2025 00:12:36 +0100 Subject: [PATCH] Refactor HTTP client setup in BuildStaticClient Simplified the HTTP client configuration in the `BuildStaticClient` method of the `ReC.Client` namespace. Replaced the explicit use of `Services.AddHttpClient` with a call to `Services.AddRecClient(apiUri)`. This change improves code readability and reusability by encapsulating the HTTP client setup logic in a dedicated method or extension. --- src/ReC.Client/ReCClient.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ReC.Client/ReCClient.cs b/src/ReC.Client/ReCClient.cs index 59218e8..92e6cb8 100644 --- a/src/ReC.Client/ReCClient.cs +++ b/src/ReC.Client/ReCClient.cs @@ -84,10 +84,7 @@ namespace ReC.Client if(Provider != null) throw new InvalidOperationException("Static Provider is already built."); - Services.AddHttpClient(ClientName, client => - { - client.BaseAddress = new Uri(apiUri); - }); + Services.AddRecClient(apiUri); Provider = Services.BuildServiceProvider(); }