CreateTableBuilder<TColumns>.ForeignKey Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String, String, ReferentialAction, ReferentialAction) |
Configure une clé étrangère à colonne unique sur la table. |
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String[], String, ReferentialAction, ReferentialAction) |
Configure une clé étrangère à plusieurs colonnes (composite) sur la table. |
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String, String, ReferentialAction, ReferentialAction)
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
Configure une clé étrangère à colonne unique sur la table.
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)
Paramètres
- name
- String
Nom de la contrainte de clé étrangère.
- column
- Expression<Func<TColumns,Object>>
Colonne utilisée pour la clé étrangère.
- principalTable
- String
Table à laquelle la clé étrangère est contrainte.
- principalColumn
- String
Colonne à laquelle la colonne de clé étrangère est contrainte.
- principalSchema
- String
Schéma qui contient la table à laquelle la clé étrangère est contrainte.
- onUpdate
- ReferentialAction
à utiliser pour les ReferentialAction mises à jour.
- onDelete
- ReferentialAction
ReferentialAction à utiliser pour les suppressions.
Retours
Le même générateur afin que plusieurs appels puissent être chaînés.
S’applique à
ForeignKey(String, Expression<Func<TColumns,Object>>, String, String[], String, ReferentialAction, ReferentialAction)
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
- Source:
- CreateTableBuilder.cs
Configure une clé étrangère à plusieurs colonnes (composite) sur la table.
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)
Paramètres
- name
- String
Nom de la contrainte de clé étrangère.
- columns
- Expression<Func<TColumns,Object>>
Colonnes utilisées pour la clé étrangère.
- principalTable
- String
Table à laquelle la clé étrangère est contrainte.
- principalColumns
- String[]
Colonnes auxquelles la colonne de clé étrangère est contrainte.
- principalSchema
- String
Schéma qui contient la table à laquelle la clé étrangère est contrainte.
- onUpdate
- ReferentialAction
à utiliser pour les ReferentialAction mises à jour.
- onDelete
- ReferentialAction
ReferentialAction à utiliser pour les suppressions.
Retours
Le même générateur afin que plusieurs appels puissent être chaînés.