.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

ValueConverterAttribute Class

Specifies that a property is made persistent using a Value Converter.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true)]
public sealed class ValueConverterAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Property Or AttributeTargets.Field, Inherited:=True)>
Public NotInheritable Class ValueConverterAttribute
    Inherits Attribute
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
public sealed class ValueConverterAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Field Or AttributeTargets.Property, Inherited:=True)>
Public NotInheritable Class ValueConverterAttribute
    Inherits Attribute

Remarks

Use this attribute to associate a ValueConverter descendant type with a property to make it persistent. Refer to the Value Converters topic for details.

Note

The value converter mechanism is designed to allow persisting non-persistent data types by transforming them into a persistable equivalent. Value converters are not intended for introducing encryption, compression, or other business logic into the persistence process.

Important
  • Properties persisted using Value Converters require the client-side conversion logic, and should not be used in criteria expressions evaluated on the database server side. An attempt to use such properties in criteria may lead to undefined behavior. For instance, when a criterion is translated to a database query, a conversion implemented programmatically may not be applied or may be applied multiple times.

  • Value Converters cannot be applied to a property that represents a primary or foreign key. Use the approach described in the How to make user-friendly object identifiers Knowledge Base article if you need to use text values for object identifiers instead of auto-generated numbers.

Inheritance

Object
Attribute
ValueConverterAttribute
See Also