Bagikan melalui


IConventionForeignKeyBuilder.HasForeignKey Metode

Definisi

Overload

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Mengonfigurasi properti yang akan digunakan sebagai kunci asing untuk hubungan ini.

HasForeignKey(IReadOnlyList<String>, Boolean)

Mengonfigurasi properti yang akan digunakan sebagai kunci asing untuk hubungan ini.

HasForeignKey(IReadOnlyList<IConventionProperty>, Boolean)

Mengonfigurasi properti yang akan digunakan sebagai kunci asing untuk hubungan ini.

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

Parameter

properties
IReadOnlyList<IConventionProperty>

Properti yang digunakan sebagai kunci asing untuk hubungan ini.

fromDataAnnotation
Boolean

Menunjukkan apakah konfigurasi ditentukan menggunakan anotasi data.

Mengembalikan

Instans penyusun yang sama jika properti dikonfigurasi sebagai kunci asing, null jika tidak.

Berlaku untuk

HasForeignKey(IReadOnlyList<String>, Boolean)

Mengonfigurasi properti yang akan digunakan sebagai kunci asing untuk hubungan ini.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder HasForeignKey (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder? HasForeignKey (System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);
abstract member HasForeignKey : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionForeignKeyBuilder
Public Function HasForeignKey (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionForeignKeyBuilder

Parameter

propertyNames
IReadOnlyList<String>

Properti yang digunakan sebagai kunci asing untuk hubungan ini.

fromDataAnnotation
Boolean

Menunjukkan apakah konfigurasi ditentukan menggunakan anotasi data.

Mengembalikan

Instans penyusun yang sama jika properti dikonfigurasi sebagai kunci asing, null jika tidak.

Berlaku untuk