共用方式為


MigrationBuilder.AddPrimaryKey 方法

定義

多載

AddPrimaryKey(String, String, String[], String)

建置 , AddPrimaryKeyOperation 將新的複合 (多資料行) 主鍵新增至資料表。

AddPrimaryKey(String, String, String, String)

建置 , AddPrimaryKeyOperation 將新的主鍵新增至資料表。

AddPrimaryKey(String, String, String[], String)

來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs

建置 , AddPrimaryKeyOperation 將新的複合 (多資料行) 主鍵新增至資料表。

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation> AddPrimaryKey (string name, string table, string[] columns, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation> AddPrimaryKey (string name, string table, string[] columns, string? schema = default);
abstract member AddPrimaryKey : string * string * string[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation>
override this.AddPrimaryKey : string * string * string[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation>
Public Overridable Function AddPrimaryKey (name As String, table As String, columns As String(), Optional schema As String = Nothing) As OperationBuilder(Of AddPrimaryKeyOperation)

參數

name
String

主鍵條件約束名稱。

table
String

將包含主鍵的資料表。

columns
String[]

構成主鍵之資料行的已排序清單。

schema
String

包含資料表的架構,或使用 null 預設架構。

傳回

建置器,允許將批註新增至作業。

備註

如需詳細資訊和範例 ,請參閱資料庫移 轉。

適用於

AddPrimaryKey(String, String, String, String)

來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs
來源:
MigrationBuilder.cs

建置 , AddPrimaryKeyOperation 將新的主鍵新增至資料表。

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation> AddPrimaryKey (string name, string table, string column, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation> AddPrimaryKey (string name, string table, string column, string? schema = default);
abstract member AddPrimaryKey : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation>
override this.AddPrimaryKey : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation>
Public Overridable Function AddPrimaryKey (name As String, table As String, column As String, Optional schema As String = Nothing) As OperationBuilder(Of AddPrimaryKeyOperation)

參數

name
String

主鍵條件約束名稱。

table
String

將包含主鍵的資料表。

column
String

構成主鍵的資料行。

schema
String

包含資料表的架構,或使用 null 預設架構。

傳回

建置器,允許將批註新增至作業。

備註

如需詳細資訊和範例 ,請參閱資料庫移 轉。

適用於