UtcDateTimeConverter.StorageType Property
Gets the type that the property’s value will be converted to when it’s saved in a data store.
Namespace: DevExpress.Xpo.Metadata
Assembly: DevExpress.Xpo.v24.1.dll
NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap, DevExpress.Xpo
NuGet Package: DevExpress.Xpo
Declaration
Property Value
Type | Description |
---|---|
Type | A Type which represents the type that the property’s value will be converted to when it’s saved in a data store. |
Remarks
The StorageType property returns the Type object for a DateTime type.
Example
The following example shows how to convert the value of the Date property from the local time to the current coordinated universal time (UTC) when persisting it in a data store.
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;
// ...
public class SampleUtc : XPObject {
private DateTime date;
[ValueConverter(typeof(UtcDateTimeConverter))]
public DateTime Date {
get { return date; }
set { SetPropertyValue(nameof(Date), ref date, value); }
}
}