共用方式為


CosmosDbContextOptionsBuilder.HttpClientFactory 方法

定義

設定內容以使用特定的 HttpClient 處理站。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder HttpClientFactory (Func<System.Net.Http.HttpClient>? httpClientFactory);
abstract member HttpClientFactory : Func<System.Net.Http.HttpClient> -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
override this.HttpClientFactory : Func<System.Net.Http.HttpClient> -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
Public Overridable Function HttpClientFactory (httpClientFactory As Func(Of HttpClient)) As CosmosDbContextOptionsBuilder

參數

httpClientFactory
Func<HttpClient>

傳回 的 HttpClient 函式。

傳回

備註

使用 靜態 Lambda 運算式 來避免建立多個實例。

如需詳細資訊和範例,請參閱 使用 DbCoNtextOptions使用 EF Core 存取 Azure Cosmos DB

適用於