From 3f7ebdb632739f23ba16044b5eed5685632796f7 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Sat, 6 Dec 2025 00:10:50 +0100 Subject: [PATCH] Simplify ReCClient instantiation in Create method Refactored the `Create` method in the `ReCClient` class to directly resolve a `ReCClient` instance from the dependency injection container using `Provider.GetRequiredService()`. Removed the intermediate step of retrieving an `IHttpClientFactory` and manually creating a `ReCClient` object. This change reduces boilerplate code and assumes `ReCClient` is already registered in the container, improving maintainability. --- src/ReC.Client/ReCClient.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ReC.Client/ReCClient.cs b/src/ReC.Client/ReCClient.cs index 795bb00..59218e8 100644 --- a/src/ReC.Client/ReCClient.cs +++ b/src/ReC.Client/ReCClient.cs @@ -102,8 +102,7 @@ namespace ReC.Client if (Provider == null) throw new InvalidOperationException("Static Provider is not built. Call BuildStaticClient first."); - var httpClientFactory = Provider.GetRequiredService(); - return new ReCClient(httpClientFactory); + return Provider.GetRequiredService(); } #endregion }