using Microsoft.Extensions.DependencyInjection; using System.Net.Http; using System.Net.WebSockets; namespace System.Extensions; public static class ServiceCollectionExtensions { /// /// Register a scoped to be used by the DI engine. /// /// Type of the scoped . /// . /// to build the http client. public static HttpClientBuilder RegisterHttpClient(this IServiceCollection services) { services.ThrowIfNull(nameof(services)); return new HttpClientBuilder(services); } /// /// Register a scoped to be used by the DI engine. /// /// Type of the scoped . /// . /// to build the websocket client. public static ClientWebSocketBuilder RegisterClientWebSocket(this IServiceCollection services) { services.ThrowIfNull(nameof(services)); return new ClientWebSocketBuilder(services); } }