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.
This commit is contained in:
Developer 02 2025-12-06 00:12:36 +01:00
parent 3f7ebdb632
commit 470902911e

View File

@ -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();
}