MigrationsSqlGenerator.DefaultValue 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| DefaultValue(Object, String, MigrationCommandListBuilder) |
產生一個 SQL 片段,作為欄位的預設約束條件。 |
| DefaultValue(Object, String, String, MigrationCommandListBuilder) |
產生一個 SQL 片段,作為欄位的預設約束條件。 |
DefaultValue(Object, String, MigrationCommandListBuilder)
產生一個 SQL 片段,作為欄位的預設約束條件。
protected virtual void DefaultValue(object defaultValue, string defaultValueSql, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
abstract member DefaultValue : obj * string * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
override this.DefaultValue : obj * string * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overridable Sub DefaultValue (defaultValue As Object, defaultValueSql As String, builder As MigrationCommandListBuilder)
參數
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- builder
- MigrationCommandListBuilder
用來新增 SQL 片段的指令建構器。
適用於
DefaultValue(Object, String, String, MigrationCommandListBuilder)
產生一個 SQL 片段,作為欄位的預設約束條件。
protected virtual void DefaultValue(object? defaultValue, string? defaultValueSql, string? columnType, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
protected virtual void DefaultValue(object defaultValue, string defaultValueSql, string columnType, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
abstract member DefaultValue : obj * string * string * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
override this.DefaultValue : obj * string * string * Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder -> unit
Protected Overridable Sub DefaultValue (defaultValue As Object, defaultValueSql As String, columnType As String, builder As MigrationCommandListBuilder)
參數
- defaultValue
- Object
資料行的預設值。
- defaultValueSql
- String
欄位預設約束的SQL表達式。
- columnType
- String
欄位的儲存/資料庫類型。
- builder
- MigrationCommandListBuilder
用來新增 SQL 片段的指令建構器。