RelationalPropertyBuilderExtensions.CanSetDefaultValue 方法

定義

傳回值,指出指定的值是否可以設定為數據行的預設值。

public static bool CanSetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, object value, bool fromDataAnnotation = false);
public static bool CanSetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, object? value, bool fromDataAnnotation = false);
static member CanSetDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * obj * bool -> bool
<Extension()>
Public Function CanSetDefaultValue (propertyBuilder As IConventionPropertyBuilder, value As Object, Optional fromDataAnnotation As Boolean = false) As Boolean

參數

propertyBuilder
IConventionPropertyBuilder

要設定之屬性的產生器。

value
Object

資料行的預設值。

fromDataAnnotation
Boolean

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

傳回

true 如果指定的值可以設定為數據行的預設值,則為 。

備註

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

適用於