Share via


IConventionElementTypeBuilder.HasConversion Method

Definition

Overloads

HasConversion(Type, Boolean)

Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database.

HasConversion(ValueConverter, Boolean)

Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database.

HasConversion(Type, Boolean)

Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder? HasConversion (Type? providerClrType, bool fromDataAnnotation = false);
abstract member HasConversion : Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder
Public Function HasConversion (providerClrType As Type, Optional fromDataAnnotation As Boolean = false) As IConventionElementTypeBuilder

Parameters

providerClrType
Type

The type to convert to and from.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

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

Applies to

HasConversion(ValueConverter, Boolean)

Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder? HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter, bool fromDataAnnotation = false);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder
Public Function HasConversion (converter As ValueConverter, Optional fromDataAnnotation As Boolean = false) As IConventionElementTypeBuilder

Parameters

converter
ValueConverter

The converter to use.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

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

Applies to