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
createTableOperation
CreateTableOperationThe 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
type
stringThe database type of the column.
unicode
bool?Indicates whether or not the column will store Unicode data.
maxLength
int?The maximum length for data in the column.
rowVersion
boolIndicates whether or not the column will act as a rowversion/timestamp concurrency token.
name
stringThe column name.
nullable
boolIndicates whether or not the column can store null values.
defaultValue
objectThe default value for the column.
defaultValueSql
stringThe SQL expression to use for the column's default constraint.
computedColumnSql
stringThe SQL expression to use to compute the column value.
fixedLength
bool?Indicates whether or not the column is constrained to fixed-length data.
comment
stringA comment to be applied to the column.
collation
stringA collation to be applied to the column.
precision
int?The maximum number of digits for data in the column.
scale
int?The maximum number of decimal places for data in the column.
stored
bool?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
T
The CLR type of the column.