Share via


SqlServerMigrationsSqlGenerator.DefaultValue Method

Definition

Generates a SQL fragment for the named default constraint of a column.

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)

Parameters

defaultValue
Object

The default value for the column.

defaultValueSql
String

The SQL expression to use for the column's default constraint.

columnType
String

Store/database type of the column.

constraintName
String

The constraint name to use to add the SQL fragment.

builder
MigrationCommandListBuilder

The command builder to use to add the SQL fragment.

Applies to