22 lines
811 B
C#
22 lines
811 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Options;
|
|
using StellaOps.Cryptography;
|
|
|
|
namespace StellaOps.Cryptography.DependencyInjection;
|
|
|
|
internal static class CryptoComplianceOptionsRegistration
|
|
{
|
|
internal static void Register(IServiceCollection services, bool bindFromConfiguration)
|
|
{
|
|
services.AddOptions<CryptoComplianceOptions>();
|
|
|
|
if (bindFromConfiguration)
|
|
{
|
|
services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CryptoComplianceOptions>, CryptoComplianceOptionsConfiguration>());
|
|
}
|
|
|
|
services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<CryptoComplianceOptions>, CryptoComplianceOptionsPostConfigure>());
|
|
}
|
|
}
|