Table of Contents

Class ValueConverterAttribute

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, Inherited = true)]
public class ValueConverterAttribute : MappingAttribute, _Attribute
Inheritance
ValueConverterAttribute
Implements
Inherited Members
Extension Methods

Properties

ConverterType

Gets or sets converter type. ConverterType should implement IValueConverter interface, should have public constructor with no parameters.

public Type? ConverterType { get; set; }

Property Value

Type

ValueConverter

ValueConverter for mapping Database Values to Model values.

public IValueConverter? ValueConverter { get; set; }

Property Value

IValueConverter

Methods

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string

GetValueConverter(ColumnDescriptor)

Returns IValueConverter for specific column.

public virtual IValueConverter? GetValueConverter(ColumnDescriptor columnDescriptor)

Parameters

columnDescriptor ColumnDescriptor

Returns

IValueConverter