SqlServerMigrationsSqlGenerator.DefaultValue 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为列的命名默认约束生成 SQL 片段。
protected virtual void DefaultValue(object? defaultValue, string? defaultValueSql, string? columnType, string? constraintName, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
override this.DefaultValue : obj * string * string * string * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overridable Sub DefaultValue (defaultValue As Object, defaultValueSql As String, columnType As String, constraintName As String, builder As MigrationCommandListBuilder)
参数
- defaultValue
- Object
列的默认值。
- defaultValueSql
- String
要用于列的默认约束的 SQL 表达式。
- columnType
- String
列的存储/数据库类型。
- constraintName
- String
用于添加 SQL 片段的约束名称。
- builder
- MigrationCommandListBuilder
用于添加 SQL 片段的命令生成器。