DelayedAttribute(String) Constructor
Initializes a new instance of the DelayedAttribute class with the name of the field which stores the delayed property’s value.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.2.dll
NuGet Package: DevExpress.Xpo
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
field |
String | A String value which specifies the name of the field which stores the value of the delayed property. This value is assigned to the Delayed |
#Remarks
By default, all properties and fields are restored from the storage when the object is loaded. For optimization purposes, it is possible to delay loading certain properties that are rarely used, or contain large amounts of data. Note that field loading cannot be delayed.
#Example
The following example demonstrates how to delay the loading of the DelayedAttachment property and improve property value update performance, by enabling the DelayedAttribute.UpdateModifiedOnly property.
Note
This solution uses the XPDelayed
using DevExpress.Xpo;
public class Customer : XPObject {
// ...
private XPDelayedProperty document = new XPDelayedProperty();
// Improve update performance for the property's value
// by passing true as the attribute's
// updateModifiedOnly parameter.
[Delayed(nameof(document), true)]
public Byte[] DelayedAttachment {
get { return (Byte[])document.Value; }
set { document.Value = value; }
}
}