diff --git a/src/ReC.Client/ReCClient.cs b/src/ReC.Client/ReCClient.cs index 92e6cb8..4249c15 100644 --- a/src/ReC.Client/ReCClient.cs +++ b/src/ReC.Client/ReCClient.cs @@ -88,6 +88,24 @@ namespace ReC.Client Provider = Services.BuildServiceProvider(); } + /// + /// Configures and builds the static for creating instances. + /// + /// + /// This method should only be called once during application startup. + /// + /// An action to configure the . + /// Thrown if the static provider has already been built. + [Obsolete("Use a local service collection instead of the static provider.")] + public static void BuildStaticClient(Action configureClient) + { + if (Provider != null) + throw new InvalidOperationException("Static Provider is already built."); + + Services.AddRecClient(configureClient); + Provider = Services.BuildServiceProvider(); + } + /// /// Creates a new instance using the statically configured provider. ///