| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using Azure.Core.Extensions; |
| | | 6 | | using Azure.Storage; |
| | | 7 | | using Azure.Storage.Files.Shares; |
| | | 8 | | |
| | | 9 | | namespace Microsoft.Extensions.Azure |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Extension methods to add <see cref="ShareServiceClient"/> client to clients builder |
| | | 13 | | /// </summary> |
| | | 14 | | public static class ShareClientBuilderExtensions |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Registers a <see cref="ShareServiceClient"/> instance with the provided <paramref name="connectionString"/> |
| | | 18 | | /// </summary> |
| | | 19 | | public static IAzureClientBuilder<ShareServiceClient, ShareClientOptions> AddFileServiceClient<TBuilder>(this TB |
| | | 20 | | where TBuilder : IAzureClientFactoryBuilder |
| | | 21 | | { |
| | 0 | 22 | | return builder.RegisterClientFactory<ShareServiceClient, ShareClientOptions>(options => new ShareServiceClie |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Registers a <see cref="ShareServiceClient"/> instance with the provided <paramref name="serviceUri"/> |
| | | 27 | | /// </summary> |
| | | 28 | | public static IAzureClientBuilder<ShareServiceClient, ShareClientOptions> AddFileServiceClient<TBuilder>(this TB |
| | | 29 | | where TBuilder : IAzureClientFactoryBuilder |
| | | 30 | | { |
| | 0 | 31 | | return builder.RegisterClientFactory<ShareServiceClient, ShareClientOptions>(options => new ShareServiceClie |
| | | 32 | | } |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Registers a <see cref="ShareServiceClient"/> instance with the provided <paramref name="serviceUri"/> and <p |
| | | 36 | | /// </summary> |
| | | 37 | | public static IAzureClientBuilder<ShareServiceClient, ShareClientOptions> AddFileServiceClient<TBuilder>(this TB |
| | | 38 | | where TBuilder : IAzureClientFactoryBuilder |
| | | 39 | | { |
| | 0 | 40 | | return builder.RegisterClientFactory<ShareServiceClient, ShareClientOptions>(options => new ShareServiceClie |
| | | 41 | | } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// Registers a <see cref="ShareServiceClient"/> instance with connection options loaded from the provided <para |
| | | 45 | | /// </summary> |
| | | 46 | | public static IAzureClientBuilder<ShareServiceClient, ShareClientOptions> AddFileServiceClient<TBuilder, TConfig |
| | | 47 | | where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> |
| | | 48 | | { |
| | 0 | 49 | | return builder.RegisterClientFactory<ShareServiceClient, ShareClientOptions>(configuration); |
| | | 50 | | } |
| | | 51 | | } |
| | | 52 | | } |