RelationalComplexTypePrimitiveCollectionBuilderExtensions.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
HasDefaultValueSql(ComplexTypePrimitiveCollectionBuilder) |
Configures the default value expression for the column that the property maps to when targeting a relational database. |
HasDefaultValueSql(ComplexTypePrimitiveCollectionBuilder, String) |
Configures the default value expression for the column that the property maps to when targeting a relational database. |
HasDefaultValueSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>) |
Configures the default value expression for the column that the property maps to when targeting a relational database. |
HasDefaultValueSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, String) |
Configures the default value expression for the column that the property maps to when targeting a relational database. |
HasDefaultValueSql(ComplexTypePrimitiveCollectionBuilder)
Configures the default value expression for the column that the property maps to when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder HasDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder primitiveCollectionBuilder);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValueSql (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder) As ComplexTypePrimitiveCollectionBuilder
Parameters
- primitiveCollectionBuilder
- ComplexTypePrimitiveCollectionBuilder
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(ComplexTypePrimitiveCollectionBuilder, 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.ComplexTypePrimitiveCollectionBuilder HasDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder primitiveCollectionBuilder, string? sql);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValueSql (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder, sql As String) As ComplexTypePrimitiveCollectionBuilder
Parameters
- primitiveCollectionBuilder
- ComplexTypePrimitiveCollectionBuilder
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>(ComplexTypePrimitiveCollectionBuilder<TProperty>)
Configures the default value expression for the column that the property maps to when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> HasDefaultValueSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder(Of TProperty)) 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.
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>(ComplexTypePrimitiveCollectionBuilder<TProperty>, 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.ComplexTypePrimitiveCollectionBuilder<TProperty> HasDefaultValueSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder, string? sql);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder(Of TProperty), sql 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.
- 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
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: