Class ColumnsBuilder
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A builder for ColumnOperation operations.
public class ColumnsBuilder
- Inheritance
-
ColumnsBuilder
- Inherited Members
Constructors
ColumnsBuilder(CreateTableOperation)
Constructs a builder for the given CreateTableOperation.
public ColumnsBuilder(CreateTableOperation createTableOperation)
Parameters
createTableOperationCreateTableOperationThe operation.
Methods
Column<T>(string, bool?, int?, bool, string, bool, object, string, string, bool?, string, string, int?, int?, bool?)
Adds a AddColumnOperation to the CreateTableOperation.
Note that for nullable parameters a null value means not-specified.
public virtual OperationBuilder<AddColumnOperation> Column<T>(string type = null, bool? unicode = null, int? maxLength = null, bool rowVersion = false, string name = null, bool nullable = false, object defaultValue = null, string defaultValueSql = null, string computedColumnSql = null, bool? fixedLength = null, string comment = null, string collation = null, int? precision = null, int? scale = null, bool? stored = null)
Parameters
typestringThe database type of the column.
unicodebool?Indicates whether or not the column will store Unicode data.
maxLengthint?The maximum length for data in the column.
rowVersionboolIndicates whether or not the column will act as a rowversion/timestamp concurrency token.
namestringThe column name.
nullableboolIndicates whether or not the column can store null values.
defaultValueobjectThe default value for the column.
defaultValueSqlstringThe SQL expression to use for the column's default constraint.
computedColumnSqlstringThe SQL expression to use to compute the column value.
fixedLengthbool?Indicates whether or not the column is constrained to fixed-length data.
commentstringA comment to be applied to the column.
collationstringA collation to be applied to the column.
precisionint?The maximum number of digits for data in the column.
scaleint?The maximum number of decimal places for data in the column.
storedbool?Whether the value of the computed column is stored in the database or not.
Returns
- OperationBuilder<AddColumnOperation>
The same builder so that multiple calls can be chained.
Type Parameters
TThe CLR type of the column.