IConventionEntityTypeBuilder.CanSetPrimaryKey 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
CanSetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean) |
傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。 |
CanSetPrimaryKey(IReadOnlyList<String>, Boolean) |
傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。 |
CanSetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)
傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member CanSetPrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> bool
Public Function CanSetPrimaryKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As Boolean
參數
- properties
- IReadOnlyList<IConventionProperty>
組成主鍵的屬性。
- fromDataAnnotation
- Boolean
指出是否使用資料批註來指定組態。
傳回
true
如果指定的屬性可以設定為主鍵,則為 。
適用於
CanSetPrimaryKey(IReadOnlyList<String>, Boolean)
傳回值,指出指定的屬性是否可以設定為此實體類型的主鍵。
public bool CanSetPrimaryKey (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member CanSetPrimaryKey : System.Collections.Generic.IReadOnlyList<string> * bool -> bool
Public Function CanSetPrimaryKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As Boolean
參數
- propertyNames
- IReadOnlyList<String>
組成索引的屬性名稱。
- fromDataAnnotation
- Boolean
指出是否使用資料批註來指定組態。
傳回
true
如果指定的屬性可以設定為主鍵,則為 。