Share via


IConventionElementTypeBuilder.HasConverter(Type, Boolean) Method

Definition

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? HasConverter (Type? converterType, bool fromDataAnnotation = false);
abstract member HasConverter : Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionElementTypeBuilder
Public Function HasConverter (converterType As Type, Optional fromDataAnnotation As Boolean = false) As IConventionElementTypeBuilder

Parameters

converterType
Type

A type that derives from ValueConverter, or null to remove any previously set converter.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

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

Applies to