HttpClientBuilderExtensions.AddTypedClient メソッド

定義

オーバーロード

AddTypedClient<TClient,TImplementation>(IHttpClientBuilder)

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。 作成されたインスタンスの型は TImplementation になります。

AddTypedClient<TClient>(IHttpClientBuilder)

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,IServiceProvider,TClient>)

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,TClient>)

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

AddTypedClient<TClient,TImplementation>(IHttpClientBuilder)

ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。 作成されたインスタンスの型は TImplementation になります。

public:
generic <typename TClient, typename TImplementation>
 where TClient : class where TImplementation : class, TClient[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddTypedClient(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddTypedClient<TClient,TImplementation> (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder) where TClient : class where TImplementation : class, TClient;
static member AddTypedClient : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddTypedClient(Of TClient As Class, TImplementation As Class) (builder As IHttpClientBuilder) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの宣言された型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、「」を参照してください ITypedHttpClientFactory<TClient>

TImplementation

型指定されたクライアントの実装型。 で指定された型は、 によって ITypedHttpClientFactory<TClient>インスタンス化されます。

パラメーター

戻り値

注釈

TClient適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient ます。

を呼び出すと AddTypedClient<TClient,TImplementation>(IHttpClientBuilder) 、 を使用して作成 TImplementation する型指定されたクライアント バインドが ITypedHttpClientFactory<TClient>登録されます。

型指定されたクライアントのサービス依存関係は、型指定されたクライアントの解決に使用されるのと同じサービス プロバイダーから解決されます。 個別に管理されるメッセージ ハンドラーにバインドされたスコープからサービスにアクセスすることはできません。

適用対象

AddTypedClient<TClient>(IHttpClientBuilder)

ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddTypedClient(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddTypedClient<TClient> (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder) where TClient : class;
static member AddTypedClient : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddTypedClient(Of TClient As Class) (builder As IHttpClientBuilder) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。 型指定されたクライアントの作成の詳細については、「」を参照してください ITypedHttpClientFactory<TClient>

パラメーター

戻り値

注釈

TClient適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient ます。

を呼び出すと AddTypedClient<TClient>(IHttpClientBuilder) 、 を使用して作成 TClient する型指定されたクライアント バインドが ITypedHttpClientFactory<TClient>登録されます。

型指定されたクライアントのサービス依存関係は、型指定されたクライアントの解決に使用されるのと同じサービス プロバイダーから解決されます。 個別に管理されるメッセージ ハンドラーにバインドされたスコープからサービスにアクセスすることはできません。

適用対象

AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,IServiceProvider,TClient>)

ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddTypedClient(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Func<System::Net::Http::HttpClient ^, IServiceProvider ^, TClient> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddTypedClient<TClient> (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Func<System.Net.Http.HttpClient,IServiceProvider,TClient> factory) where TClient : class;
static member AddTypedClient : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Func<System.Net.Http.HttpClient, IServiceProvider, 'Client (requires 'Client : null)> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddTypedClient(Of TClient As Class) (builder As IHttpClientBuilder, factory As Func(Of HttpClient, IServiceProvider, TClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。

パラメーター

factory
Func<HttpClient,IServiceProvider,TClient>

型指定されたクライアントの構築に使用されるファクトリ関数。

戻り値

注釈

TClient適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient ます。

を呼び出すと AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,IServiceProvider,TClient>) 、指定されたファクトリ関数を使用して作成 TClient する型指定されたクライアント バインドが登録されます。

適用対象

AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,TClient>)

ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs
ソース:
HttpClientBuilderExtensions.cs

IHttpClientBuilder で関連付けられている TClient 型と名前付き HttpClient の間のバインドを構成します。

public:
generic <typename TClient>
 where TClient : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddTypedClient(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Func<System::Net::Http::HttpClient ^, TClient> ^ factory);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddTypedClient<TClient> (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Func<System.Net.Http.HttpClient,TClient> factory) where TClient : class;
static member AddTypedClient : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Func<System.Net.Http.HttpClient, 'Client (requires 'Client : null)> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder (requires 'Client : null)
<Extension()>
Public Function AddTypedClient(Of TClient As Class) (builder As IHttpClientBuilder, factory As Func(Of HttpClient, TClient)) As IHttpClientBuilder

型パラメーター

TClient

型指定されたクライアントの型。 指定された型は、一時的なサービスとしてサービス コレクションに登録されます。

パラメーター

factory
Func<HttpClient,TClient>

型指定されたクライアントの構築に使用されるファクトリ関数。

戻り値

注釈

TClient適切なを使用して構築されたインスタンスは、 HttpClientGetService(Type) サービスの種類としてを指定することによって、(および関連するメソッド) から取得でき TClient ます。

を呼び出すと AddTypedClient<TClient>(IHttpClientBuilder, Func<HttpClient,TClient>) 、指定されたファクトリ関数を使用して作成 TClient する型指定されたクライアント バインドが登録されます。

適用対象