Share via


SqlServerPrimitiveCollectionBuilderExtensions.HasDefaultValue Method

Definition

Overloads

Name Description
HasDefaultValue(PrimitiveCollectionBuilder, Object, String)

Configures the default value for the column that the property maps to when targeting a relational database.

HasDefaultValue<TProperty>(PrimitiveCollectionBuilder<TProperty>, Object, String)

Configures the default value for the column that the property maps to when targeting a relational database.

HasDefaultValue(PrimitiveCollectionBuilder, Object, String)

Source:
SqlServerPrimitiveCollectionBuilderExtensions.cs

Configures the default value for the column that the property maps to when targeting a relational database.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder HasDefaultValue(this Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder primitiveCollectionBuilder, object? value, string defaultConstraintName);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder * obj * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValue (primitiveCollectionBuilder As PrimitiveCollectionBuilder, value As Object, defaultConstraintName As String) As PrimitiveCollectionBuilder

Parameters

primitiveCollectionBuilder
PrimitiveCollectionBuilder

The builder for the property being configured.

value
Object

The default value of the column.

defaultConstraintName
String

The default constraint name.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Database default values for more information and examples.

Applies to

HasDefaultValue<TProperty>(PrimitiveCollectionBuilder<TProperty>, Object, String)

Source:
SqlServerPrimitiveCollectionBuilderExtensions.cs

Configures the default value for the column that the property maps to when targeting a relational database.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> HasDefaultValue<TProperty>(this Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder, object? value, string defaultConstraintName);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property> * obj * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValue(Of TProperty) (primitiveCollectionBuilder As PrimitiveCollectionBuilder(Of TProperty), value As Object, defaultConstraintName As String) As PrimitiveCollectionBuilder(Of TProperty)

Type Parameters

TProperty

The type of the property being configured.

Parameters

primitiveCollectionBuilder
PrimitiveCollectionBuilder<TProperty>

The builder for the property being configured.

value
Object

The default value of the column.

defaultConstraintName
String

The default constraint name.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Database default values for more information and examples.

Applies to