Delen via


RelationalPropertyBuilderExtensions.IsStoredComputedColumn Method

Definition

Configures the property to map to a computed column of the given type when targeting a relational database.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder IsStoredComputedColumn (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, bool? stored, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? IsStoredComputedColumn (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, bool? stored, bool fromDataAnnotation = false);
static member IsStoredComputedColumn : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function IsStoredComputedColumn (propertyBuilder As IConventionPropertyBuilder, stored As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

Parameters

propertyBuilder
IConventionPropertyBuilder

The builder for the property being configured.

stored
Nullable<Boolean>

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.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Remarks

See Database default values for more information and examples.

Applies to