Compartir a través de


IConventionEntityType.SetPrimaryKey Método

Definición

Sobrecargas

SetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

Establece la clave principal para este tipo de entidad.

SetPrimaryKey(IConventionProperty, Boolean)

Establece la clave principal para este tipo de entidad.

SetPrimaryKey(IReadOnlyList<IConventionProperty>, Boolean)

Establece la clave principal para este tipo de entidad.

public Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.IConventionKey? SetPrimaryKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? properties, bool fromDataAnnotation = false);
abstract member SetPrimaryKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Function SetPrimaryKey (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionKey

Parámetros

properties
IReadOnlyList<IConventionProperty>

Propiedades que componen la clave principal.

fromDataAnnotation
Boolean

Indica si la configuración se especificó mediante una anotación de datos.

Devoluciones

Clave recién creada.

Se aplica a

SetPrimaryKey(IConventionProperty, Boolean)

Establece la clave principal para este tipo de entidad.

public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
public virtual Microsoft.EntityFrameworkCore.Metadata.IConventionKey? SetPrimaryKey (Microsoft.EntityFrameworkCore.Metadata.IConventionProperty? property, bool fromDataAnnotation = false);
abstract member SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
override this.SetPrimaryKey : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionKey
Public Overridable Function SetPrimaryKey (property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionKey

Parámetros

property
IConventionProperty

Propiedad de clave principal.

fromDataAnnotation
Boolean

Indica si la configuración se especificó mediante una anotación de datos.

Devoluciones

Clave recién creada.

Se aplica a