Share via


RelationalPrimitiveCollectionBuilderExtensions.HasDefaultValueSql Method

Definition

Overloads

HasDefaultValueSql(PrimitiveCollectionBuilder)

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

HasDefaultValueSql(PrimitiveCollectionBuilder, String)

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

HasDefaultValueSql<TProperty>(PrimitiveCollectionBuilder<TProperty>)

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

HasDefaultValueSql<TProperty>(PrimitiveCollectionBuilder<TProperty>, String)

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

HasDefaultValueSql(PrimitiveCollectionBuilder)

Source:
RelationalPrimitiveCollectionBuilderExtensions.cs
Source:
RelationalPrimitiveCollectionBuilderExtensions.cs

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder HasDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder primitiveCollectionBuilder);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValueSql (primitiveCollectionBuilder As PrimitiveCollectionBuilder) As PrimitiveCollectionBuilder

Parameters

primitiveCollectionBuilder
PrimitiveCollectionBuilder

The builder for the property being configured.

Returns

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

Remarks

When called with no argument, this method tells EF that a column has a default value constraint of some sort without needing to specify exactly what it is. This can be useful when mapping EF to an existing database.

See Database default values for more information and examples.

Applies to

HasDefaultValueSql(PrimitiveCollectionBuilder, String)

Source:
RelationalPrimitiveCollectionBuilderExtensions.cs
Source:
RelationalPrimitiveCollectionBuilderExtensions.cs

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder HasDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder primitiveCollectionBuilder, string? sql);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValueSql (primitiveCollectionBuilder As PrimitiveCollectionBuilder, sql As String) As PrimitiveCollectionBuilder

Parameters

primitiveCollectionBuilder
PrimitiveCollectionBuilder

The builder for the property being configured.

sql
String

The SQL expression for the default value of the column.

Returns

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

Remarks

See Database default values for more information and examples.

Applies to

HasDefaultValueSql<TProperty>(PrimitiveCollectionBuilder<TProperty>)

Source:
RelationalPrimitiveCollectionBuilderExtensions.cs
Source:
RelationalPrimitiveCollectionBuilderExtensions.cs

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> HasDefaultValueSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property> -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (primitiveCollectionBuilder As PrimitiveCollectionBuilder(Of TProperty)) 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.

Returns

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

Remarks

When called with no argument, this method tells EF that a column has a default value constraint of some sort without needing to specify exactly what it is. This can be useful when mapping EF to an existing database.

See Database default values for more information and examples.

Applies to

HasDefaultValueSql<TProperty>(PrimitiveCollectionBuilder<TProperty>, String)

Source:
RelationalPrimitiveCollectionBuilderExtensions.cs
Source:
RelationalPrimitiveCollectionBuilderExtensions.cs

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> HasDefaultValueSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder, string? sql);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (primitiveCollectionBuilder As PrimitiveCollectionBuilder(Of TProperty), sql 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.

sql
String

The SQL expression for the default value of the column.

Returns

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

Remarks

See Database default values for more information and examples.

Applies to