using Microsoft.Extensions.DependencyInjection; namespace StellaOps.Scanner.Surface.Env; public static class ServiceCollectionExtensions { public static IServiceCollection AddSurfaceEnvironment( this IServiceCollection services, Action? configure = null) { if (services is null) { throw new ArgumentNullException(nameof(services)); } services.AddSingleton(sp => SurfaceEnvironmentFactory.Create(sp, configure)); return services; } }