SqlServerPrimitiveCollectionBuilderExtensions.HasDefaultValueSql Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| HasDefaultValueSql(PrimitiveCollectionBuilder, String, String) |
Configures the default value expression for the column that the property maps to when targeting a relational database. |
| HasDefaultValueSql<TProperty>(PrimitiveCollectionBuilder<TProperty>, String, String) |
Configures the default value expression for the column that the property maps to when targeting a relational database. |
HasDefaultValueSql(PrimitiveCollectionBuilder, String, String)
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, string defaultConstraintName);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder * string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValueSql (primitiveCollectionBuilder As PrimitiveCollectionBuilder, sql As String, defaultConstraintName 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.
- 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
HasDefaultValueSql<TProperty>(PrimitiveCollectionBuilder<TProperty>, String, String)
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, string defaultConstraintName);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property> * string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (primitiveCollectionBuilder As PrimitiveCollectionBuilder(Of TProperty), sql As String, 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.
- sql
- String
The SQL expression for 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.