AzureClientFactoryBuilder.IAzureClientFactoryBuilderWithCredential.RegisterClientFactory<TClient,TOptions>(Func<TOptions,TokenCredential,TClient>, Boolean) Method

Definition

Registers a client in dependency injection container the using the factory to create a client instance.

Azure.Core.Extensions.IAzureClientBuilder<TClient,TOptions> IAzureClientFactoryBuilderWithCredential.RegisterClientFactory<TClient,TOptions> (Func<TOptions,Azure.Core.TokenCredential,TClient> clientFactory, bool requiresCredential) where TOptions : class;
abstract member Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential.RegisterClientFactory : Func<'Options, Azure.Core.TokenCredential, 'Client (requires 'Options : null)> * bool -> Azure.Core.Extensions.IAzureClientBuilder<'Client, 'Options (requires 'Options : null)> (requires 'Options : null)
override this.Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential.RegisterClientFactory : Func<'Options, Azure.Core.TokenCredential, 'Client (requires 'Options : null)> * bool -> Azure.Core.Extensions.IAzureClientBuilder<'Client, 'Options (requires 'Options : null)> (requires 'Options : null)
Function RegisterClientFactory(Of TClient, TOptions) (clientFactory As Func(Of TOptions, TokenCredential, TClient), requiresCredential As Boolean) As IAzureClientBuilder(Of TClient, TOptions) Implements IAzureClientFactoryBuilderWithCredential.RegisterClientFactory

Type Parameters

TClient

The type of the client.

TOptions

The client options type used the client.

Parameters

clientFactory
System.Func<TOptions,TokenCredential,TClient>

The factory, that given the instance of options and credential, returns a client instance.

requiresCredential
System.Boolean

Specifies whether the credential is optional (client supports anonymous authentication).

Returns

IAzureClientBuilder<TClient,TOptions>

IAzureClientBuilder<TClient,TOptions> that allows customizing the client registration.

Implements

Applies to