Skip to main content
.NET Framework 4.5.2+

ValueConverterAttribute Class

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

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v23.1.dll

NuGet Package: DevExpress.Xpo


[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true)]
public sealed class ValueConverterAttribute :


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


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.


  • 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.


See Also