Пример #1
0
        public AzureClientFactory(IEnumerable <ClientRegistration <TClient, TOptions> > clientRegistrations, IOptionsMonitor <TOptions> monitor, EventSourceLogForwarder logForwarder)
        {
            _clientRegistrations = new Dictionary <string, ClientRegistration <TClient, TOptions> >();
            foreach (var registration in clientRegistrations)
            {
                _clientRegistrations[registration.Name] = registration;
            }

            _monitor      = monitor;
            _logForwarder = logForwarder;
        }
        public AzureClientFactory(
            IServiceProvider serviceProvider,
            IOptionsMonitor <AzureClientCredentialOptions <TClient> > clientsOptions,
            IEnumerable <ClientRegistration <TClient, TOptions> > clientRegistrations, IOptionsMonitor <TOptions> monitor,
            EventSourceLogForwarder logForwarder)
        {
            _clientRegistrations = new Dictionary <string, ClientRegistration <TClient, TOptions> >();
            foreach (var registration in clientRegistrations)
            {
                _clientRegistrations[registration.Name] = registration;
            }

            _serviceProvider = serviceProvider;
            _clientsOptions  = clientsOptions;
            _monitor         = monitor;
            _logForwarder    = logForwarder;
        }