DbMigration.AlterTableAnnotations<TColumns> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
新增一個操作以處理資料表上定義註解的變更。
實體框架遷移 API 並非設計用來接受不受信任來源(例如應用程式的最終使用者)提供的輸入。 若接受來自這些來源的輸入,應在傳遞給這些 API 前進行驗證,以防止 SQL 注入攻擊等攻擊。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void AlterTableAnnotations<TColumns>(string name, Func<System.Data.Entity.Migrations.Builders.ColumnBuilder,TColumns> columnsAction, System.Collections.Generic.IDictionary<string,System.Data.Entity.Infrastructure.Annotations.AnnotationValues> annotations, object anonymousArguments = null);
member this.AlterTableAnnotations : string * Func<System.Data.Entity.Migrations.Builders.ColumnBuilder, 'Columns> * System.Collections.Generic.IDictionary<string, System.Data.Entity.Infrastructure.Annotations.AnnotationValues> * obj -> unit
Protected Friend Sub AlterTableAnnotations(Of TColumns) (name As String, columnsAction As Func(Of ColumnBuilder, TColumns), annotations As IDictionary(Of String, AnnotationValues), Optional anonymousArguments As Object = null)
類型參數
- TColumns
這次行動中的柱子。 你不需要指定這個類型,它會從你提供的 columnsAction 參數推斷出來。
參數
- name
- String
數據表的名稱。 結構名稱為可選,若未指定結構,則假設為 dbo。
- columnsAction
- Func<ColumnBuilder,TColumns>
一個指定要包含在表格中的欄位的動作。 即 t => new { id = t.Int(身份:true),Name = t。字串() }
- annotations
- IDictionary<String,AnnotationValues>
表格上的自訂註解已經改變。
- anonymousArguments
- Object
醫療提供者可能會處理其他爭議。 使用匿名型別語法來指定參數,例如 'new { SampleArgument = “MyValue” }'。
- 屬性