RelationalPropertyBuilderExtensions.CanSetDefaultValueSql 方法

定義

傳回值,指出是否可以為資料行設定指定的預設值運算式。

public static bool CanSetDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string sql, bool fromDataAnnotation = false);
public static bool CanSetDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? sql, bool fromDataAnnotation = false);
static member CanSetDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> bool
<Extension()>
Public Function CanSetDefaultValueSql (propertyBuilder As IConventionPropertyBuilder, sql As String, Optional fromDataAnnotation As Boolean = false) As Boolean

參數

propertyBuilder
IConventionPropertyBuilder

要設定之屬性的產生器。

sql
String

資料行預設值的 SQL 運算式。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

true 如果可以為資料行設定指定的預設值運算式,則為 。

備註

如需詳細資訊和範例,請參閱 資料庫預設值

適用於