ColumnsBuilder.Column 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Column<T>(String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String)
將 AddColumnOperation 加入至 CreateTableOperation。
請注意,對於可為 Null 的參數, null
值表示未指定。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Column<T> (string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string name = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Column<T> (string type, bool? unicode, int? maxLength, bool rowVersion, string name, bool nullable, object defaultValue, string defaultValueSql, string computedColumnSql);
abstract member Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
override this.Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
Public Overridable Function Column(Of T) (Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional name As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing) As OperationBuilder(Of AddColumnOperation)
Public Overridable Function Column(Of T) (type As String, unicode As Nullable(Of Boolean), maxLength As Nullable(Of Integer), rowVersion As Boolean, name As String, nullable As Boolean, defaultValue As Object, defaultValueSql As String, computedColumnSql As String) As OperationBuilder(Of AddColumnOperation)
類型參數
- T
資料行的 CLR 類型。
參數
- type
- String
資料行的資料庫類型。
- rowVersion
- Boolean
指出資料行是否會作為 rowversion/timestamp 並行權杖。
- name
- String
資料行名稱。
- nullable
- Boolean
指出資料行是否可以儲存 NULL
值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
要用於資料行預設條件約束的 SQL 運算式。
- computedColumnSql
- String
用來計算資料行值的 SQL 運算式。
傳回
相同的產生器,讓多個呼叫可以鏈結。
適用於
Column<T>(String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Nullable<Boolean>)
將 AddColumnOperation 加入至 CreateTableOperation。
請注意,對於可為 Null 的參數, null
值表示未指定。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Column<T> (string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string name = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, bool? fixedLength = default);
abstract member Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
override this.Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
Public Overridable Function Column(Of T) (Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional name As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional fixedLength As Nullable(Of Boolean) = Nothing) As OperationBuilder(Of AddColumnOperation)
類型參數
- T
資料行的 CLR 類型。
參數
- type
- String
資料行的資料庫類型。
- rowVersion
- Boolean
指出資料行是否會作為 rowversion/timestamp 並行權杖。
- name
- String
資料行名稱。
- nullable
- Boolean
指出資料行是否可以儲存 NULL
值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
要用於資料行預設條件約束的 SQL 運算式。
- computedColumnSql
- String
用來計算資料行值的 SQL 運算式。
傳回
相同的產生器,讓多個呼叫可以鏈結。
適用於
Column<T>(String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Nullable<Boolean>, String)
將 AddColumnOperation 加入至 CreateTableOperation。
請注意,對於可為 Null 的參數, null
值表示未指定。
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Column<T> (string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string name = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, bool? fixedLength = default, string comment = default);
abstract member Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Nullable<bool> * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
override this.Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Nullable<bool> * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
Public Overridable Function Column(Of T) (Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional name As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional fixedLength As Nullable(Of Boolean) = Nothing, Optional comment As String = Nothing) As OperationBuilder(Of AddColumnOperation)
類型參數
- T
資料行的 CLR 類型。
參數
- type
- String
資料行的資料庫類型。
- rowVersion
- Boolean
指出資料行是否會作為 rowversion/timestamp 並行權杖。
- name
- String
資料行名稱。
- nullable
- Boolean
指出資料行是否可以儲存 NULL
值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
要用於資料行預設條件約束的 SQL 運算式。
- computedColumnSql
- String
用來計算資料行值的 SQL 運算式。
- comment
- String
要套用至資料表的批註。
傳回
相同的產生器,讓多個呼叫可以鏈結。
適用於
Column<T>(String, Nullable<Boolean>, Nullable<Int32>, Boolean, String, Boolean, Object, String, String, Nullable<Boolean>, String, String, Nullable<Int32>, Nullable<Int32>, Nullable<Boolean>)
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Column<T> (string type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string name = default, bool nullable = false, object defaultValue = default, string defaultValueSql = default, string computedColumnSql = default, bool? fixedLength = default, string comment = default, string collation = default, int? precision = default, int? scale = default, bool? stored = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation> Column<T> (string? type = default, bool? unicode = default, int? maxLength = default, bool rowVersion = false, string? name = default, bool nullable = false, object? defaultValue = default, string? defaultValueSql = default, string? computedColumnSql = default, bool? fixedLength = default, string? comment = default, string? collation = default, int? precision = default, int? scale = default, bool? stored = default);
abstract member Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Nullable<bool> * string * string * Nullable<int> * Nullable<int> * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
override this.Column : string * Nullable<bool> * Nullable<int> * bool * string * bool * obj * string * string * Nullable<bool> * string * string * Nullable<int> * Nullable<int> * Nullable<bool> -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation>
Public Overridable Function Column(Of T) (Optional type As String = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional maxLength As Nullable(Of Integer) = Nothing, Optional rowVersion As Boolean = false, Optional name As String = Nothing, Optional nullable As Boolean = false, Optional defaultValue As Object = Nothing, Optional defaultValueSql As String = Nothing, Optional computedColumnSql As String = Nothing, Optional fixedLength As Nullable(Of Boolean) = Nothing, Optional comment As String = Nothing, Optional collation As String = Nothing, Optional precision As Nullable(Of Integer) = Nothing, Optional scale As Nullable(Of Integer) = Nothing, Optional stored As Nullable(Of Boolean) = Nothing) As OperationBuilder(Of AddColumnOperation)
類型參數
- T
資料行的 CLR 類型。
參數
- type
- String
資料行的資料庫類型。
- rowVersion
- Boolean
指出資料行是否會作為 rowversion/timestamp 並行權杖。
- name
- String
資料行名稱。
- nullable
- Boolean
指出資料行是否可以儲存 null
值。
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
要用於資料行預設條件約束的 SQL 運算式。
- computedColumnSql
- String
用來計算資料行值的 SQL 運算式。
- comment
- String
要套用至資料行的批註。
- collation
- String
要套用至資料行的定序。
傳回
相同的產生器,讓多個呼叫可以鏈結。
備註
請注意,對於可為 Null 的參數, null
值表示未指定。