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 片段的指令建構器。