.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
A newer version of this page is available. Switch to the current version.

NonPersistentAttribute Class

Indicates that a class, property, or field will not be stored in a persistent data store.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface)]
public sealed class NonPersistentAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Property Or AttributeTargets.Field Or AttributeTargets.Interface)>
Public NotInheritable Class NonPersistentAttribute
    Inherits Attribute
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Property)]
public sealed class NonPersistentAttribute :
    Attribute
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Field Or AttributeTargets.Interface Or AttributeTargets.Property)>
Public NotInheritable Class NonPersistentAttribute
    Inherits Attribute

Remarks

Apply the NonPersistentAttribute attribute to a property or class if you don't want to store its data that is persistent by default.


[NonPersistent]
public class MyBusinessObject : XPObject {
   //...
}

The NonPersistentAttribute is not inherited by derived classes.

IMPORTANT

Do not use the NonPersistentAttribute to make a class non-persistent in eXpressApp Framework applications. Instead, apply the DomainComponentAttribute to a POCO class, as demonstrated in the Non-Persistent Objects topic in XAF documentation.

Inheritance

See Also