MigrationBuilder.AddUniqueConstraint 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddUniqueConstraint(String, String, String, String) |
建置 , AddUniqueConstraintOperation 以將新的唯一條件約束加入至資料表。 |
AddUniqueConstraint(String, String, String[], String) |
建置 , AddUniqueConstraintOperation 將新的複合 (多資料行) 唯一條件約束新增至資料表。 |
AddUniqueConstraint(String, String, String, String)
建置 , AddUniqueConstraintOperation 以將新的唯一條件約束加入至資料表。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string column, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string column, string? schema = default);
abstract member AddUniqueConstraint : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
override this.AddUniqueConstraint : string * string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
Public Overridable Function AddUniqueConstraint (name As String, table As String, column As String, Optional schema As String = Nothing) As OperationBuilder(Of AddUniqueConstraintOperation)
參數
- name
- String
條件約束名稱。
- table
- String
將包含條件約束的資料表。
- column
- String
受限制的資料行。
- schema
- String
包含資料表的架構,或使用 null
預設架構。
傳回
允許將批註加入至作業的產生器。
備註
如需詳細資訊和範例 ,請參閱資料庫移轉 。
適用於
AddUniqueConstraint(String, String, String[], String)
建置 , AddUniqueConstraintOperation 將新的複合 (多資料行) 唯一條件約束新增至資料表。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string[] columns, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation> AddUniqueConstraint (string name, string table, string[] columns, string? schema = default);
abstract member AddUniqueConstraint : string * string * string[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
override this.AddUniqueConstraint : string * string * string[] * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation>
Public Overridable Function AddUniqueConstraint (name As String, table As String, columns As String(), Optional schema As String = Nothing) As OperationBuilder(Of AddUniqueConstraintOperation)
參數
- name
- String
條件約束名稱。
- table
- String
將包含條件約束的資料表。
- columns
- String[]
受限制之資料行的已排序清單。
- schema
- String
包含資料表的架構,或使用 null
預設架構。
傳回
允許將批註加入至作業的產生器。
備註
如需詳細資訊和範例 ,請參閱資料庫移轉 。