Aracılığıyla paylaş


ConventionEntityTypeExtensions.SetPrimaryKey Yöntem

Tanım

Bu varlık türü için birincil anahtarı ayarlar.

public static Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
static member SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
<Extension()>
Public Function SetPrimaryKey (entityType As IConventionEntityType, property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionKey

Parametreler

entityType
IConventionEntityType

Anahtarın ayarlanacağı varlık türü.

property
IConventionProperty

Birincil anahtar özelliği.

fromDataAnnotation
Boolean

Yapılandırmanın bir veri ek açıklaması kullanılarak belirtilip belirtilmedidiğini gösterir.

Döndürülenler

Yeni oluşturulan anahtar.

Şunlara uygulanır