MutableEntityTypeExtensions.GetOrSetPrimaryKey 方法

定義

多載

GetOrSetPrimaryKey(IMutableEntityType, IMutableProperty)

取得實體的現有主鍵,或在未定義實體時加以設定。

GetOrSetPrimaryKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)

取得實體的現有主鍵,或在未定義實體時加以設定。

GetOrSetPrimaryKey(IMutableEntityType, IMutableProperty)

取得實體的現有主鍵,或在未定義實體時加以設定。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrSetPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property);
static member GetOrSetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * Microsoft.EntityFrameworkCore.Metadata.IMutableProperty -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrSetPrimaryKey (entityType As IMutableEntityType, property As IMutableProperty) As IMutableKey

參數

entityType
IMutableEntityType

要取得或設定索引鍵的實體類型。

property
IMutableProperty

如果尚未定義屬性,要設定為主鍵的屬性。

傳回

現有的或新建立的金鑰。

適用於

GetOrSetPrimaryKey(IMutableEntityType, IReadOnlyList<IMutableProperty>)

取得實體的現有主鍵,或在未定義實體時加以設定。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableKey GetOrSetPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties);
static member GetOrSetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> -> Microsoft.EntityFrameworkCore.Metadata.IMutableKey
<Extension()>
Public Function GetOrSetPrimaryKey (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty)) As IMutableKey

參數

entityType
IMutableEntityType

要取得或設定索引鍵的實體類型。

properties
IReadOnlyList<IMutableProperty>

如果尚未定義屬性,要設定為主鍵的屬性。

傳回

現有的或新建立的金鑰。

適用於