語言

AlterTableOperation 類別

定義

A MigrationOperation 用來修改現有的表格。

public class AlterTableOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation, Microsoft.EntityFrameworkCore.Migrations.Operations.IAlterMigrationOperation
[System.Diagnostics.DebuggerDisplay("ALTER TABLE {Name}")]
[System.Runtime.CompilerServices.Nullable(0)]
public class AlterTableOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.TableOperation, Microsoft.EntityFrameworkCore.Migrations.Operations.IAlterMigrationOperation
public class AlterTableOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.TableOperation, Microsoft.EntityFrameworkCore.Migrations.Operations.IAlterMigrationOperation
[System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table}")]
public class AlterTableOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.TableOperation, Microsoft.EntityFrameworkCore.Migrations.Operations.IAlterMigrationOperation
[System.Diagnostics.DebuggerDisplay("ALTER TABLE {Name}")]
public class AlterTableOperation : Microsoft.EntityFrameworkCore.Migrations.Operations.TableOperation, Microsoft.EntityFrameworkCore.Migrations.Operations.IAlterMigrationOperation
type AlterTableOperation = class
    inherit MigrationOperation
    interface IAlterMigrationOperation
[<System.Diagnostics.DebuggerDisplay("ALTER TABLE {Name}")>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type AlterTableOperation = class
    inherit TableOperation
    interface IAlterMigrationOperation
type AlterTableOperation = class
    inherit TableOperation
    interface IAlterMigrationOperation
[<System.Diagnostics.DebuggerDisplay("ALTER TABLE {Table}")>]
type AlterTableOperation = class
    inherit TableOperation
    interface IAlterMigrationOperation
[<System.Diagnostics.DebuggerDisplay("ALTER TABLE {Name}")>]
type AlterTableOperation = class
    inherit TableOperation
    interface IAlterMigrationOperation
Public Class AlterTableOperation
Inherits MigrationOperation
Implements IAlterMigrationOperation
Public Class AlterTableOperation
Inherits TableOperation
Implements IAlterMigrationOperation
繼承
AlterTableOperation
繼承
繼承
屬性
實作

備註

更多資訊與範例請參見 資料庫遷移 。

建構函式

名稱 Description
AlterTableOperation()

A MigrationOperation 用來修改現有的表格。

屬性

名稱 Description
Comment

對此表的評論

(繼承來源 TableOperation)
IsDestructiveChange

表示操作是否可能導致資料庫資料遺失。

(繼承來源 MigrationOperation)
IsReadOnly

表示目前物件是否為唯讀。

(繼承來源 AnnotatableBase)
Item[String]

取得帶有名稱的值註解,若不存在則回 null 傳。

(繼承來源 Annotatable)
Name

數據表的名稱。

Name

數據表的名稱。

(繼承來源 TableOperation)
OldTable

這是一張代表桌子被修改前樣貌的操作。

Schema

包含該表格的結構,或 null 是否應該使用預設結構。

Schema

包含該表格的結構,或 null 是否應該使用預設結構。

(繼承來源 TableOperation)

方法

名稱 Description
AddAnnotation(String, Annotation)

為此物件新增註解。 如果已有指定名稱的註解存在,則會拋出。

(繼承來源 Annotatable)
AddAnnotation(String, Object)

為此物件新增註解。 如果已有指定名稱的註解存在,則會拋出。

(繼承來源 Annotatable)
AddAnnotations(IEnumerable<IAnnotation>)

為此物件新增註解。

(繼承來源 AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

為此物件新增註解。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

為此物件新增執行時註解。 如果已有指定名稱的註解存在,則會拋出。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotation(String, Object)

為此物件新增執行時註解。 如果已有指定名稱的註解存在,則會拋出。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

為此物件新增執行時註解。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

為此物件新增執行時註解。

(繼承來源 AnnotatableBase)
CreateAnnotation(String, Object)

建立新的註解。

(繼承來源 Annotatable)
CreateRuntimeAnnotation(String, Object)

建立新的執行時註解。

(繼承來源 AnnotatableBase)
EnsureMutable()

如果模型是唯讀,則會拋出。

(繼承來源 Annotatable)
EnsureReadOnly()

若模型非唯讀,則會擲出。

(繼承來源 Annotatable)
FindAnnotation(String)

取得帶有名字的註解,若不存在則回 null 傳。

(繼承來源 Annotatable)
FindRuntimeAnnotation(String)

取得帶有名稱的執行時註解,若不存在則回 null 傳。

(繼承來源 AnnotatableBase)
GetAnnotation(String)

取得帶有名稱的註解,若不存在則拋出。

(繼承來源 AnnotatableBase)
GetAnnotations()

取得目前物件的所有註解。

(繼承來源 Annotatable)
GetOrAddAnnotation(String, Object)

為此物件新增註解,或若已有已具指定名稱的註解,則回傳該標註。

(繼承來源 Annotatable)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

取得帶有名稱的執行時註解值,若不存在則加入該註解。

(繼承來源 AnnotatableBase)
GetRuntimeAnnotations()

取得目前物件上的所有執行時註解。

(繼承來源 AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

當註解被設定或移除時會被呼叫。

(繼承來源 Annotatable)
RemoveAnnotation(String)

移除該物件中給定的註解。

(繼承來源 Annotatable)
RemoveRuntimeAnnotation(String)

移除該物件中給定的執行時註解。

(繼承來源 AnnotatableBase)
SetAnnotation(String, Annotation, Annotation)

設定在指定鍵下儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。

(繼承來源 Annotatable)
SetAnnotation(String, Annotation)

設定在指定鍵下儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。

(繼承來源 Annotatable)
SetAnnotation(String, Object)

設定在指定鍵下儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。

(繼承來源 Annotatable)
SetRuntimeAnnotation(String, Annotation, Annotation)

設定在指定鍵值下儲存的執行時註解。 若已有指定名稱的註解存在,則會覆寫現有註解。

(繼承來源 AnnotatableBase)
SetRuntimeAnnotation(String, Object)

設定在指定鍵值下儲存的執行時註解。 若已有指定名稱的註解存在,則會覆寫現有註解。

(繼承來源 AnnotatableBase)

明確介面實作

名稱 Description
IAlterMigrationOperation.OldAnnotations

他們 OldTable 會被檢視註解。

IAnnotatable.AddRuntimeAnnotation(String, Object)

為此物件新增執行時註解。 如果已有指定名稱的註解存在,則會拋出。

(繼承來源 AnnotatableBase)
IAnnotatable.FindAnnotation(String)

取得帶有名稱的註解,若不存在則回傳 null。

(繼承來源 Annotatable)
IAnnotatable.FindRuntimeAnnotation(String)

取得帶有名稱的執行時註解,若不存在則回 null 傳。

(繼承來源 AnnotatableBase)
IAnnotatable.GetAnnotations()

取得目前物件的所有註解。

(繼承來源 Annotatable)
IAnnotatable.GetRuntimeAnnotations()

取得目前物件上的所有執行時註解。

(繼承來源 AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

移除該物件中給定的執行時註解。

(繼承來源 AnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

設定在指定鍵值下儲存的執行時註解。 若已有指定名稱的註解存在,則會覆寫現有註解。

(繼承來源 AnnotatableBase)
IMutableAnnotatable.AddAnnotation(String, Object)

為此物件新增註解。 如果已有指定名稱的註解存在,則會拋出。

(繼承來源 Annotatable)
IMutableAnnotatable.RemoveAnnotation(String)

移除該物件中給定的註解。

(繼承來源 Annotatable)
IMutableAnnotatable.SetOrRemoveAnnotation(String, Object)

設定以名字儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。 若 null 提供 則移除現有註解。

(繼承來源 Annotatable)
IReadOnlyAnnotatable.FindAnnotation(String)

取得帶有名字的註解,若不存在則回 null 傳。

(繼承來源 AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

取得目前物件的所有註解。

(繼承來源 AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

取得帶有名稱的註解值,若不存在則回 null 傳。

(繼承來源 AnnotatableBase)
ITableMigrationOperation.Table

包含此操作目標的表格。

(繼承來源 TableOperation)

擴充方法

名稱 Description
AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

為物件添加註解。

AnnotationsToDebugString(IAnnotatable, Int32)

取得物件上所有宣告註解的除錯字串。

GetAnnotation(IAnnotatable, String)

取得帶有名稱的註解,若不存在則拋出。

GetAnnotation(IMutableAnnotatable, String)

取得帶有名稱的註解,若不存在則拋出。

GetOrAddAnnotation(IMutableAnnotatable, String, String)

取得帶有特定鍵的現有註解,或若不存在註解則新增。

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

設定以名字儲存的註解。 若已有指定名稱的註解存在,則會覆寫現有註解。 若 null 提供 則移除現有註解。

適用於