| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using Azure.Core.Extensions; |
| | 5 | | using Azure.Data.AppConfiguration; |
| | 6 | |
|
| | 7 | | namespace Microsoft.Extensions.Azure |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Extension methods to add <see cref="ConfigurationClient"/> client to clients builder. |
| | 11 | | /// </summary> |
| | 12 | | public static class ConfigurationClientBuilderExtensions |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Registers a <see cref="ConfigurationClient"/> instance with the provided <paramref name="connectionString"/> |
| | 16 | | /// </summary> |
| | 17 | | public static IAzureClientBuilder<ConfigurationClient, ConfigurationClientOptions> AddConfigurationClient<TBuild |
| | 18 | | where TBuilder : IAzureClientFactoryBuilder |
| | 19 | | { |
| 0 | 20 | | return builder.RegisterClientFactory<ConfigurationClient, ConfigurationClientOptions>(options => new Configu |
| | 21 | | } |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Registers a <see cref="ConfigurationClient"/> instance with connection options loaded from the provided <par |
| | 25 | | /// </summary> |
| | 26 | | public static IAzureClientBuilder<ConfigurationClient, ConfigurationClientOptions> AddConfigurationClient<TBuild |
| | 27 | | where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> |
| | 28 | | { |
| 0 | 29 | | return builder.RegisterClientFactory<ConfigurationClient, ConfigurationClientOptions>(configuration); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |