語言

CosmosDbContextOptionsBuilder.SessionTokenManagementMode 方法

定義

設定 SessionTokenManagementMode to 使用。 預設情況下,將使用 FullyAutomatic。 其他模式只有在你的應用程式需要手動管理會話令牌時才有意義。 舉例來說:如果你使用的是輪詢負載平衡器,且不維持請求間的會話親和性。 手動會話令牌管理若處理不當,可能會破壞會話一致性。 請參閱 利用會話標記 請參閱更多詳細資料。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder SessionTokenManagementMode(Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.SessionTokenManagementMode mode);
abstract member SessionTokenManagementMode : Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.SessionTokenManagementMode -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
override this.SessionTokenManagementMode : Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.SessionTokenManagementMode -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
Public Overridable Function SessionTokenManagementMode (mode As SessionTokenManagementMode) As CosmosDbContextOptionsBuilder

參數

傳回

備註

更多資訊與範例請參閱使用 DbContextOptions 及 Access Azure Cosmos DB with EF Core。

適用於