UseInAuditTrailAttribute Class
Specifies whether a property takes part in audit.
Namespace: DevExpress.Persistent.Base
Assembly: DevExpress.ExpressApp.v25.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Remarks
The UseInAuditTrailAttribute
is a part of Audit Trail Module functionality and specifies whether a property participates in the audit. You can use this attribute to customize the default Audit Trail module behavior.
Default Audit Trail Module Behavior
The Audit Trail Module logs changes in the following objects and properties:
- Persistent classes.
- Public writable simple and reference properties defined in persistent classes.
- Public collection properties defined in persistent classes.
Read-only properties (those without a setter) and properties decorated with the NonPersistentAttribute are excluded from the audit trail.
Exclude a Property from the Audit Trail
Apply the UseInAuditTrailAttribute
with its Include
parameter set to false
to stop logging property changes:
[UseInAuditTrail(false)]
public virtual string MyPersistentProperty { get; set; }
Include a Non-Persistent Property in the Audit Trail
To log changes in a non-persistent property, apply the UseInAuditTrailAttribute
with its Include
parameter set to true
:
[UseInAuditTrail(true)]
[NotMapped]
public string MyNonPersistentProperty { get; set; }