using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Svrnty.CQRS.Abstractions.Security; namespace Svrnty.CQRS.Altcha; public static class ServiceCollectionExtensions { /// /// Registers as both an /// and an /// . The check is a no-op until /// an /// implementation is also registered (typically via /// AddSvrntyAltchaGrpcVerifier(...) from /// Svrnty.CQRS.Altcha.Grpc). /// /// /// Idempotent for the concrete check; the multi-instance interface /// registrations are added unconditionally, so callers should invoke /// this exactly once per application startup. /// public static IServiceCollection AddSvrntyAltcha(this IServiceCollection services) { services.TryAddSingleton(); services.AddSingleton(sp => sp.GetRequiredService()); services.AddSingleton(sp => sp.GetRequiredService()); return services; } }