共用方式為


SqlServerComplexTypePrimitiveCollectionBuilderExtensions.HasDefaultValue Method

Definition

Overloads

Name Description
HasDefaultValue(ComplexTypePrimitiveCollectionBuilder, Object, String)

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

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

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

HasDefaultValue(ComplexTypePrimitiveCollectionBuilder, Object, String)

Source:
SqlServerComplexTypePrimitiveCollectionBuilderExtensions.cs

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

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

Parameters

primitiveCollectionBuilder
ComplexTypePrimitiveCollectionBuilder

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>(ComplexTypePrimitiveCollectionBuilder<TProperty>, Object, String)

Source:
SqlServerComplexTypePrimitiveCollectionBuilderExtensions.cs

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

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

Type Parameters

TProperty

The type of the property being configured.

Parameters

primitiveCollectionBuilder
ComplexTypePrimitiveCollectionBuilder<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