Udostępnij za pośrednictwem


CreateTableBuilder<TColumns>.ForeignKey Metoda

Definicja

Przeciążenia

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

Konfiguruje klucz obcy z jedną kolumną w tabeli.

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

Konfiguruje wielokolumny (złożony) klucz obcy w tabeli.

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

Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs

Konfiguruje klucz obcy z jedną kolumną w tabeli.

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)

Parametry

name
String

Nazwa ograniczenia klucza obcego.

column
Expression<Func<TColumns,Object>>

Kolumna używana dla klucza obcego.

principalTable
String

Tabela, do której jest ograniczony klucz obcy.

principalColumn
String

Kolumna, do której jest ograniczona kolumna klucza obcego.

principalSchema
String

Schemat zawierający tabelę, z którą jest ograniczony klucz obcy.

onUpdate
ReferentialAction

Element ReferentialAction do użycia na potrzeby aktualizacji.

onDelete
ReferentialAction

Element ReferentialAction do użycia do usuwania.

Zwraca

Ten sam konstruktor, aby można było połączyć wiele wywołań.

Dotyczy

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

Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs
Źródło:
CreateTableBuilder.cs

Konfiguruje wielokolumny (złożony) klucz obcy w tabeli.

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)

Parametry

name
String

Nazwa ograniczenia klucza obcego.

columns
Expression<Func<TColumns,Object>>

Kolumny używane dla klucza obcego.

principalTable
String

Tabela, do której jest ograniczony klucz obcy.

principalColumns
String[]

Kolumny, dla których jest ograniczona kolumna klucza obcego.

principalSchema
String

Schemat zawierający tabelę, z którą jest ograniczony klucz obcy.

onUpdate
ReferentialAction

Element ReferentialAction do użycia na potrzeby aktualizacji.

onDelete
ReferentialAction

Element ReferentialAction do użycia do usuwania.

Zwraca

Ten sam konstruktor, aby można było połączyć wiele wywołań.

Dotyczy