CreateCheckConstraintOperation 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
A MigrationOperation 用於建立新的檢查約束。
public class CreateCheckConstraintOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation
[System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table} ADD CONSTRAINT {Name} CHECK")]
public class CreateCheckConstraintOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation
type CreateCheckConstraintOperation = class
inherit MigrationOperation
[<System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table} ADD CONSTRAINT {Name} CHECK")>]
type CreateCheckConstraintOperation = class
inherit MigrationOperation
Public Class CreateCheckConstraintOperation
Inherits MigrationOperation
- 繼承
- 屬性
建構函式
| 名稱 | Description |
|---|---|
| CreateCheckConstraintOperation() |
A MigrationOperation 用於建立新的檢查約束。 |
屬性
| 名稱 | Description |
|---|---|
| IsDestructiveChange |
表示操作是否可能導致資料庫資料遺失。 (繼承來源 MigrationOperation) |
| Item[String] |
取得帶有名稱的值註解,若不存在則回 |
| Name |
檢查約束的名稱。 |
| Schema |
包含檢查約束的表格結構,或 |
| Sql |
CHECK 約束中使用的邏輯 SQL 表達式,回傳 TRUE 或 FALSE。 搭配 CHECK 約束的 SQL 無法參考其他資料表,但可以參考同一資料表中同一列的其他欄位。 這個運算式不能參考別名資料類型。 |
| Table |
檢查約束表。 |
方法
| 名稱 | Description |
|---|---|
| AddAnnotation(String, Annotation) |
為此物件新增註解。 如果已有指定名稱的註解存在,則會拋出。 (繼承來源 Annotatable) |
| AddAnnotation(String, Object) |
為此物件新增註解。 如果已有指定名稱的註解存在,則會拋出。 (繼承來源 Annotatable) |
| CreateAnnotation(String, Object) |
建立新的註解。 (繼承來源 Annotatable) |
| FindAnnotation(String) |
取得帶有名字的註解,若不存在則回 |
| GetAnnotations() |
取得目前物件的所有註解。 (繼承來源 Annotatable) |
| OnAnnotationSet(String, Annotation, Annotation) |
當註解被設定或移除時會被呼叫。 (繼承來源 Annotatable) |
| RemoveAnnotation(String) |
移除該物件中給定的註解。 (繼承來源 Annotatable) |
| SetAnnotation(String, Annotation, Annotation) |
設定在指定鍵下儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。 (繼承來源 Annotatable) |
| SetAnnotation(String, Object) |
設定在指定鍵下儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。 (繼承來源 Annotatable) |
明確介面實作
| 名稱 | Description |
|---|---|
| IAnnotatable.FindAnnotation(String) |
取得帶有名稱的註解,若不存在則回傳 null。 (繼承來源 Annotatable) |
| IAnnotatable.GetAnnotations() |
取得目前物件的所有註解。 (繼承來源 Annotatable) |
| IMutableAnnotatable.AddAnnotation(String, Object) |
為此物件新增註解。 如果已有指定名稱的註解存在,則會拋出。 (繼承來源 Annotatable) |
| IMutableAnnotatable.RemoveAnnotation(String) |
移除該物件中給定的註解。 (繼承來源 Annotatable) |
擴充方法
| 名稱 | Description |
|---|---|
| AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>) |
為物件添加註解。 |
| GetAnnotation(IAnnotatable, String) |
取得帶有名稱的註解,若不存在則拋出。 |
| GetAnnotation(IMutableAnnotatable, String) |
取得帶有名稱的註解,若不存在則拋出。 |
| SetOrRemoveAnnotation(IMutableAnnotatable, String, Object) |
設定以名字儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。 若 |