Compartilhar via


IConventionSkipNavigation.SetForeignKey Método

Definição

Define a chave estrangeira.

public Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey SetForeignKey (Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey foreignKey, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey? SetForeignKey (Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey? foreignKey, bool fromDataAnnotation = false);
abstract member SetForeignKey : Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionForeignKey
Public Function SetForeignKey (foreignKey As IConventionForeignKey, Optional fromDataAnnotation As Boolean = false) As IConventionForeignKey

Parâmetros

foreignKey
IConventionForeignKey

A chave estrangeira. Passar null resultará na não associação de chave estrangeira.

fromDataAnnotation
Boolean

Indica se a configuração foi especificada usando uma anotação de dados.

Retornos

A nova chave estrangeira.

Aplica-se a