Share via


ComplexTypePropertyBuilder.HasConversion Method

Definition

Overloads

HasConversion(Type, Type, Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion(Type, ValueComparer, ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion(Type, Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion(ValueConverter, ValueComparer, ValueComparer)

Configures the property so that the property value is converted to and from the database using the given ValueConverter.

HasConversion(ValueConverter, ValueComparer)

Configures the property so that the property value is converted to and from the database using the given ValueConverter.

HasConversion(Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion(ValueConverter)

Configures the property so that the property value is converted to and from the database using the given ValueConverter.

HasConversion(Type, ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion<TConversion,TComparer,TProviderComparer>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion<TConversion,TComparer>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion<TConversion>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion<TConversion>(ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion<TConversion>(ValueComparer, ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

HasConversion(Type, Type, Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Type conversionType, Type? comparerType, Type? providerComparerType);
abstract member HasConversion : Type * Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Type * Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, comparerType As Type, providerComparerType As Type) As ComplexTypePropertyBuilder

Parameters

conversionType
Type

The type to convert to and from or a type that inherits from ValueConverter.

comparerType
Type

A type that inherits from ValueComparer.

providerComparerType
Type

A type that inherits from ValueComparer to use for the provider values.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(Type, ValueComparer, ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Type conversionType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerComparer);
abstract member HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, valueComparer As ValueComparer, providerComparer As ValueComparer) As ComplexTypePropertyBuilder

Parameters

conversionType
Type

The type to convert to and from or a type that inherits from ValueConverter.

valueComparer
ValueComparer

The comparer to use for values before conversion.

providerComparer
ValueComparer

The comparer to use for the provider values.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(Type, Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Type conversionType, Type? comparerType);
abstract member HasConversion : Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, comparerType As Type) As ComplexTypePropertyBuilder

Parameters

conversionType
Type

The type to convert to and from or a type that inherits from ValueConverter.

comparerType
Type

A type that inherits from ValueComparer.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(ValueConverter, ValueComparer, ValueComparer)

Configures the property so that the property value is converted to and from the database using the given ValueConverter.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (converter As ValueConverter, valueComparer As ValueComparer, providerComparer As ValueComparer) As ComplexTypePropertyBuilder

Parameters

converter
ValueConverter

The converter to use.

valueComparer
ValueComparer

The comparer to use for values before conversion.

providerComparer
ValueComparer

The comparer to use for the provider values.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(ValueConverter, ValueComparer)

Configures the property so that the property value is converted to and from the database using the given ValueConverter.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (converter As ValueConverter, valueComparer As ValueComparer) As ComplexTypePropertyBuilder

Parameters

converter
ValueConverter

The converter to use.

valueComparer
ValueComparer

The comparer to use for values before conversion.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(Type)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Type? conversionType);
abstract member HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (conversionType As Type) As ComplexTypePropertyBuilder

Parameters

conversionType
Type

The type to convert to and from or a type that inherits from ValueConverter.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(ValueConverter)

Configures the property so that the property value is converted to and from the database using the given ValueConverter.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (converter As ValueConverter) As ComplexTypePropertyBuilder

Parameters

converter
ValueConverter

The converter to use.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion(Type, ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion (Type conversionType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, valueComparer As ValueComparer) As ComplexTypePropertyBuilder

Parameters

conversionType
Type

The type to convert to and from or a type that inherits from ValueConverter.

valueComparer
ValueComparer

The comparer to use for values before conversion.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion<TConversion,TComparer,TProviderComparer>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion<TConversion,TComparer,TProviderComparer> () where TComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer where TProviderComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer;
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer and 'ProviderComparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer and 'ProviderComparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
Public Overridable Function HasConversion(Of TConversion, TComparer, TProviderComparer) () As ComplexTypePropertyBuilder

Type Parameters

TConversion

The type to convert to and from or a type that inherits from ValueConverter.

TComparer

A type that inherits from ValueComparer.

TProviderComparer

A type that inherits from ValueComparer to use for the provider values.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion<TConversion,TComparer>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion<TConversion,TComparer> () where TComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer;
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
Public Overridable Function HasConversion(Of TConversion, TComparer) () As ComplexTypePropertyBuilder

Type Parameters

TConversion

The type to convert to and from or a type that inherits from ValueConverter.

TComparer

A type that inherits from ValueComparer.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion<TConversion>()

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion<TConversion> ();
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion(Of TConversion) () As ComplexTypePropertyBuilder

Type Parameters

TConversion

The type to convert to and from or a type that inherits from ValueConverter.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion<TConversion>(ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion<TConversion> (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion(Of TConversion) (valueComparer As ValueComparer) As ComplexTypePropertyBuilder

Type Parameters

TConversion

The type to convert to and from or a type that inherits from ValueConverter.

Parameters

valueComparer
ValueComparer

The comparer to use for values before conversion.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to

HasConversion<TConversion>(ValueComparer, ValueComparer)

Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasConversion<TConversion> (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
Public Overridable Function HasConversion(Of TConversion) (valueComparer As ValueComparer, providerComparer As ValueComparer) As ComplexTypePropertyBuilder

Type Parameters

TConversion

The type to convert to and from or a type that inherits from ValueConverter.

Parameters

valueComparer
ValueComparer

The comparer to use for values before conversion.

providerComparer
ValueComparer

The comparer to use for the provider values.

Returns

The same builder instance so that multiple configuration calls can be chained.

Applies to