CosmosEntityTypeBuilderExtensions.CanSetPartitionKey 方法

定義

傳回值,指出是否可從目前的組態來源設定用來儲存資料分割索引鍵的屬性

public static bool CanSetPartitionKey (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string name, bool fromDataAnnotation = false);
public static bool CanSetPartitionKey (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);
static member CanSetPartitionKey : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * string * bool -> bool
<Extension()>
Public Function CanSetPartitionKey (entityTypeBuilder As IConventionEntityTypeBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As Boolean

參數

entityTypeBuilder
IConventionEntityTypeBuilder

正在設定之實體類型的產生器。

name
String

資料分割索引鍵屬性的名稱。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

true 如果可以套用設定,則為 。

備註

如需詳細資訊和範例,請參閱 模型化實體類型和關聯性,以及 使用 EF Core 存取 Azure Cosmos DB

適用於