using IWS5.Core.Models.Configuration;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;

namespace IWS5.LdapClient.Extensions;

public class LdapConfigurationSetup : IConfigureOptions<LdapConfig>
{
    private readonly IConfiguration _configuration;

    public LdapConfigurationSetup(IConfiguration configuration)
    {
        _configuration = configuration;
    }

    public void Configure(LdapConfig options)
    {
        _configuration.GetSection(LdapConfig.SectionName).Bind(options);
    }
}
