Table of Contents

Class ConverterMappingHints

Namespace
Microsoft.EntityFrameworkCore.Storage.ValueConversion
Assembly
Microsoft.EntityFrameworkCore.dll

Specifies hints used by the type mapper when mapping using a ValueConverter.

public class ConverterMappingHints
Inheritance
ConverterMappingHints
Inherited Members

Remarks

See EF Core value converters for more information and examples.

Constructors

ConverterMappingHints(int?, int?, int?, bool?, Func<IProperty, IEntityType, ValueGenerator>?)

Creates a new ConverterMappingHints instance. Any hint contained in the instance can be null to indicate it has not been specified.

public ConverterMappingHints(int? size = null, int? precision = null, int? scale = null, bool? unicode = null, Func<IProperty, IEntityType, ValueGenerator>? valueGeneratorFactory = null)

Parameters

size int?

The suggested size of the mapped data type.

precision int?

The suggested precision of the mapped data type.

scale int?

The suggested scale of the mapped data type.

unicode bool?

Whether or not the mapped data type should support Unicode.

valueGeneratorFactory Func<IProperty, IEntityType, ValueGenerator>

An optional factory for creating a specific ValueGenerator.

Remarks

See EF Core value converters for more information and examples.

Properties

IsUnicode

Whether or not the mapped data type should support Unicode.

public virtual bool? IsUnicode { get; }

Property Value

bool?

Precision

The suggested precision of the mapped data type.

public virtual int? Precision { get; }

Property Value

int?

Scale

The suggested scale of the mapped data type.

public virtual int? Scale { get; }

Property Value

int?

Size

The suggested size of the mapped data type.

public virtual int? Size { get; }

Property Value

int?

ValueGeneratorFactory

An optional factory for creating a specific ValueGenerator to use for model values when this converter is being used.

[Obsolete]
public virtual Func<IProperty, IEntityType, ValueGenerator>? ValueGeneratorFactory { get; }

Property Value

Func<IProperty, IEntityType, ValueGenerator>

Methods

OverrideWith(ConverterMappingHints?)

Adds hints from the given object to this one. Hints that are already specified are overridden.

public virtual ConverterMappingHints OverrideWith(ConverterMappingHints? hints)

Parameters

hints ConverterMappingHints

The hints to add.

Returns

ConverterMappingHints

The combined hints.

Remarks

See EF Core value converters for more information and examples.

With(ConverterMappingHints?)

Adds hints from the given object to this one. Hints that are already specified are not overridden.

public virtual ConverterMappingHints With(ConverterMappingHints? hints)

Parameters

hints ConverterMappingHints

The hints to add.

Returns

ConverterMappingHints

The combined hints.

Remarks

See EF Core value converters for more information and examples.