| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using Microsoft.Extensions.Options; |
| | | 6 | | |
| | | 7 | | namespace Microsoft.Extensions.Azure |
| | | 8 | | { |
| | | 9 | | internal class ConfigureClientOptions<TClient, TOptions> : IConfigureNamedOptions<TOptions> where TOptions : class |
| | | 10 | | { |
| | | 11 | | private readonly IServiceProvider _serviceProvider; |
| | | 12 | | private readonly ClientRegistration<TClient, TOptions> _registration; |
| | | 13 | | private readonly Action<TOptions, IServiceProvider> _configureOptions; |
| | | 14 | | |
| | 12 | 15 | | public ConfigureClientOptions(IServiceProvider serviceProvider, ClientRegistration<TClient, TOptions> registrati |
| | | 16 | | { |
| | 12 | 17 | | _serviceProvider = serviceProvider; |
| | 12 | 18 | | _registration = registration; |
| | 12 | 19 | | _configureOptions = configureOptions; |
| | 12 | 20 | | } |
| | | 21 | | |
| | | 22 | | public void Configure(TOptions options) |
| | | 23 | | { |
| | 0 | 24 | | } |
| | | 25 | | |
| | | 26 | | public void Configure(string name, TOptions options) |
| | | 27 | | { |
| | 16 | 28 | | if (name == _registration.Name) |
| | | 29 | | { |
| | 12 | 30 | | _configureOptions(options, _serviceProvider); |
| | | 31 | | } |
| | 16 | 32 | | } |
| | | 33 | | } |
| | | 34 | | } |