Freigeben über


CreateTableBuilder<TColumns>.ForeignKey Methode

Definition

Überlädt

ForeignKey(String, Expression<Func<TColumns,Object>>, String, String, String, ReferentialAction, ReferentialAction)

Konfiguriert einen einspaltigen Fremdschlüssel für die Tabelle.

ForeignKey(String, Expression<Func<TColumns,Object>>, String, String[], String, ReferentialAction, ReferentialAction)

Konfiguriert einen mehrspaltigen (zusammengesetzten) Fremdschlüssel für die Tabelle.

ForeignKey(String, Expression<Func<TColumns,Object>>, String, String, String, ReferentialAction, ReferentialAction)

Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs

Konfiguriert einen einspaltigen Fremdschlüssel für die Tabelle.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation> ForeignKey (string name, System.Linq.Expressions.Expression<Func<TColumns,object>> column, string principalTable, string principalColumn, string principalSchema = default, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onUpdate = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onDelete = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation> ForeignKey (string name, System.Linq.Expressions.Expression<Func<TColumns,object>> column, string principalTable, string? principalColumn = default, string? principalSchema = default, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onUpdate = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onDelete = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction);
abstract member ForeignKey : string * System.Linq.Expressions.Expression<Func<'Columns, obj>> * string * string * string * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation>
override this.ForeignKey : string * System.Linq.Expressions.Expression<Func<'Columns, obj>> * string * string * string * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation>
Public Overridable Function ForeignKey (name As String, column As Expression(Of Func(Of TColumns, Object)), principalTable As String, principalColumn As String, Optional principalSchema As String = Nothing, Optional onUpdate As ReferentialAction = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Optional onDelete As ReferentialAction = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction) As OperationBuilder(Of AddForeignKeyOperation)
Public Overridable Function ForeignKey (name As String, column As Expression(Of Func(Of TColumns, Object)), principalTable As String, Optional principalColumn As String = Nothing, Optional principalSchema As String = Nothing, Optional onUpdate As ReferentialAction = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Optional onDelete As ReferentialAction = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction) As OperationBuilder(Of AddForeignKeyOperation)

Parameter

name
String

Der Name der Fremdschlüsseleinschränkung.

column
Expression<Func<TColumns,Object>>

Die Spalte, die für den Fremdschlüssel verwendet wird.

principalTable
String

Die Tabelle, für die der Fremdschlüssel eingeschränkt ist.

principalColumn
String

Die Spalte, auf die die Fremdschlüsselspalte beschränkt ist.

principalSchema
String

Das Schema, das die Tabelle enthält, an die der Fremdschlüssel eingeschränkt ist.

onUpdate
ReferentialAction

Die ReferentialAction , die für Updates verwendet werden soll.

onDelete
ReferentialAction

Die ReferentialAction , die für Löschvorgänge verwendet werden soll.

Gibt zurück

Derselbe Generator, damit mehrere Aufrufe verkettet werden können.

Gilt für:

ForeignKey(String, Expression<Func<TColumns,Object>>, String, String[], String, ReferentialAction, ReferentialAction)

Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs
Quelle:
CreateTableBuilder.cs

Konfiguriert einen mehrspaltigen (zusammengesetzten) Fremdschlüssel für die Tabelle.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation> ForeignKey (string name, System.Linq.Expressions.Expression<Func<TColumns,object>> columns, string principalTable, string[] principalColumns, string principalSchema = default, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onUpdate = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onDelete = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation> ForeignKey (string name, System.Linq.Expressions.Expression<Func<TColumns,object>> columns, string principalTable, string[]? principalColumns, string? principalSchema = default, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onUpdate = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Microsoft.EntityFrameworkCore.Migrations.ReferentialAction onDelete = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction);
abstract member ForeignKey : string * System.Linq.Expressions.Expression<Func<'Columns, obj>> * string * string[] * string * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation>
override this.ForeignKey : string * System.Linq.Expressions.Expression<Func<'Columns, obj>> * string * string[] * string * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction * Microsoft.EntityFrameworkCore.Migrations.ReferentialAction -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation>
Public Overridable Function ForeignKey (name As String, columns As Expression(Of Func(Of TColumns, Object)), principalTable As String, principalColumns As String(), Optional principalSchema As String = Nothing, Optional onUpdate As ReferentialAction = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction, Optional onDelete As ReferentialAction = Microsoft.EntityFrameworkCore.Migrations.ReferentialAction.NoAction) As OperationBuilder(Of AddForeignKeyOperation)

Parameter

name
String

Der Name der Fremdschlüsseleinschränkung.

columns
Expression<Func<TColumns,Object>>

Die Spalten, die für den Fremdschlüssel verwendet werden.

principalTable
String

Die Tabelle, für die der Fremdschlüssel eingeschränkt ist.

principalColumns
String[]

Die Spalten, auf die die Fremdschlüsselspalte eingeschränkt ist.

principalSchema
String

Das Schema, das die Tabelle enthält, an die der Fremdschlüssel eingeschränkt ist.

onUpdate
ReferentialAction

Die ReferentialAction , die für Updates verwendet werden soll.

onDelete
ReferentialAction

Die ReferentialAction , die für Löschvorgänge verwendet werden soll.

Gibt zurück

Derselbe Generator, damit mehrere Aufrufe verkettet werden können.

Gilt für: