diff --git a/src/ReC.Client/ReCClient.cs b/src/ReC.Client/ReCClient.cs index 9f81ff7..586f5fc 100644 --- a/src/ReC.Client/ReCClient.cs +++ b/src/ReC.Client/ReCClient.cs @@ -49,31 +49,31 @@ namespace ReC.Client private static readonly IServiceCollection Services = new ServiceCollection(); #if NET8_0_OR_GREATER - private static IServiceProvider? ServiceProvider = null; + private static IServiceProvider? Provider = null; #else - private static IServiceProvider ServiceProvider = null; + private static IServiceProvider Provider = null; #endif public static void BuildStaticClient(string apiUri) { - if(ServiceProvider != null) - throw new InvalidOperationException("Static ServiceProvider is already built."); + if(Provider != null) + throw new InvalidOperationException("Static Provider is already built."); Services.AddHttpClient(ClientName, client => { client.BaseAddress = new Uri(apiUri); }); - ServiceProvider = Services.BuildServiceProvider(); + Provider = Services.BuildServiceProvider(); } public static ReCClient Static { get { - if (ServiceProvider == null) - throw new InvalidOperationException("Static ServiceProvider is not built. Call BuildStaticClient first."); + if (Provider == null) + throw new InvalidOperationException("Static Provider is not built. Call BuildStaticClient first."); - var httpClientFactory = ServiceProvider.GetRequiredService(); + var httpClientFactory = Provider.GetRequiredService(); return new ReCClient(httpClientFactory); } }