CreateTableBuilder<TColumns>.ForeignKey Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String, String, ReferentialAction, ReferentialAction) |
Configura uma chave estrangeira de coluna única na tabela. |
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String[], String, ReferentialAction, ReferentialAction) |
Configura uma chave estrangeira de várias colunas (composição) na tabela. |
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String, String, ReferentialAction, ReferentialAction)
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
Configura uma chave estrangeira de coluna única na tabela.
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)
Parâmetros
- name
- String
O nome da restrição de chave estrangeira.
- column
- Expression<Func<TColumns,Object>>
A coluna usada para a chave estrangeira.
- principalTable
- String
A tabela à qual a chave estrangeira é restrita.
- principalColumn
- String
A coluna à qual a coluna de chave estrangeira é restrita.
- principalSchema
- String
O esquema que contém a tabela à qual a chave estrangeira é restrita.
- onUpdate
- ReferentialAction
O ReferentialAction a ser usado para atualizações.
- onDelete
- ReferentialAction
O ReferentialAction a ser usado para exclusões.
Retornos
O mesmo construtor para que várias chamadas possam ser encadeadas.
Aplica-se a
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String[], String, ReferentialAction, ReferentialAction)
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
- Origem:
- CreateTableBuilder.cs
Configura uma chave estrangeira de várias colunas (composição) na tabela.
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)
Parâmetros
- name
- String
O nome da restrição de chave estrangeira.
- columns
- Expression<Func<TColumns,Object>>
As colunas usadas para a chave estrangeira.
- principalTable
- String
A tabela à qual a chave estrangeira é restrita.
- principalColumns
- String[]
As colunas às quais a coluna de chave estrangeira é restrita.
- principalSchema
- String
O esquema que contém a tabela à qual a chave estrangeira é restrita.
- onUpdate
- ReferentialAction
O ReferentialAction a ser usado para atualizações.
- onDelete
- ReferentialAction
O ReferentialAction a ser usado para exclusões.
Retornos
O mesmo construtor para que várias chamadas possam ser encadeadas.
Aplica-se a
Entity Framework