RelationalComplexTypePrimitiveCollectionBuilderExtensions.HasDefaultValue 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
HasDefaultValue(ComplexTypePrimitiveCollectionBuilder) |
Configures the default value for the column that the property maps to when targeting a relational database. |
HasDefaultValue(ComplexTypePrimitiveCollectionBuilder, Object) |
Configures the default value for the column that the property maps to when targeting a relational database. |
HasDefaultValue<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>) |
Configures the default value for the column that the property maps to when targeting a relational database. |
HasDefaultValue<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, Object) |
Configures the default value for the column that the property maps to when targeting a relational database. |
HasDefaultValue(ComplexTypePrimitiveCollectionBuilder)
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);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValue (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
HasDefaultValue(ComplexTypePrimitiveCollectionBuilder, Object)
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);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder * obj -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasDefaultValue (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder, value As Object) As ComplexTypePrimitiveCollectionBuilder
Parameters
- primitiveCollectionBuilder
- ComplexTypePrimitiveCollectionBuilder
The builder for the property being configured.
- value
- Object
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
HasDefaultValue<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>)
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);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValue(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
HasDefaultValue<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, Object)
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);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> * obj -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasDefaultValue(Of TProperty) (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder(Of TProperty), value As Object) 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.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Database default values for more information and examples.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor