RelationalComplexTypePrimitiveCollectionBuilderExtensions.HasComputedColumnSql 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
HasComputedColumnSql(ComplexTypePrimitiveCollectionBuilder) |
Configures the property to map to a computed column when targeting a relational database. |
HasComputedColumnSql(ComplexTypePrimitiveCollectionBuilder, String) |
Configures the property to map to a computed column when targeting a relational database. |
HasComputedColumnSql(ComplexTypePrimitiveCollectionBuilder, String, Nullable<Boolean>) |
Configures the property to map to a computed column when targeting a relational database. |
HasComputedColumnSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, String) |
Configures the property to map to a computed column when targeting a relational database. |
HasComputedColumnSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, String, Nullable<Boolean>) |
Configures the property to map to a computed column when targeting a relational database. |
HasComputedColumnSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>) |
Configures the property to map to a computed column when targeting a relational database. |
HasComputedColumnSql(ComplexTypePrimitiveCollectionBuilder)
Configures the property to map to a computed column when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder HasComputedColumnSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder primitiveCollectionBuilder);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasComputedColumnSql (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 arguments, this method tells EF that a column is computed without needing to specify the actual SQL used to computed it. This can be useful when mapping EF to an existing database.
See Database default values for more information and examples.
Applies to
HasComputedColumnSql(ComplexTypePrimitiveCollectionBuilder, String)
Configures the property to map to a computed column when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder HasComputedColumnSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder primitiveCollectionBuilder, string? sql);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasComputedColumnSql (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder, sql As String) As ComplexTypePrimitiveCollectionBuilder
Parameters
- primitiveCollectionBuilder
- ComplexTypePrimitiveCollectionBuilder
The builder for the property being configured.
- sql
- String
The SQL expression that computes values for 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
HasComputedColumnSql(ComplexTypePrimitiveCollectionBuilder, String, Nullable<Boolean>)
Configures the property to map to a computed column when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder HasComputedColumnSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder primitiveCollectionBuilder, string? sql, bool? stored);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder * string * Nullable<bool> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder
<Extension()>
Public Function HasComputedColumnSql (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder, sql As String, stored As Nullable(Of Boolean)) As ComplexTypePrimitiveCollectionBuilder
Parameters
- primitiveCollectionBuilder
- ComplexTypePrimitiveCollectionBuilder
The builder for the property being configured.
- sql
- String
The SQL expression that computes values for the column.
If true
, the computed value is calculated on row modification and stored in the database like a regular column.
If false
, the value is computed when the value is read, and does not occupy any actual storage.
null
selects the database provider default.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Database default values for more information and examples.
Applies to
HasComputedColumnSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, String)
Configures the property to map to a computed column when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> HasComputedColumnSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder, string? sql);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasComputedColumnSql(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 that computes values for 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
HasComputedColumnSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>, String, Nullable<Boolean>)
Configures the property to map to a computed column when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> HasComputedColumnSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder, string? sql, bool? stored);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> * string * Nullable<bool> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasComputedColumnSql(Of TProperty) (primitiveCollectionBuilder As ComplexTypePrimitiveCollectionBuilder(Of TProperty), sql As String, stored As Nullable(Of Boolean)) 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 that computes values for the column.
If true
, the computed value is calculated on row modification and stored in the database like a regular column.
If false
, the value is computed when the value is read, and does not occupy any actual storage.
null
selects the database provider default.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Database default values for more information and examples.
Applies to
HasComputedColumnSql<TProperty>(ComplexTypePrimitiveCollectionBuilder<TProperty>)
Configures the property to map to a computed column when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> HasComputedColumnSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<TProperty> primitiveCollectionBuilder);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePrimitiveCollectionBuilder<'Property>
<Extension()>
Public Function HasComputedColumnSql(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 arguments, this method tells EF that a column is computed without needing to specify the actual SQL used to computed it. This can be useful when mapping EF to an existing database.
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