expressappframework-devexpress-dot-persistent-dot-base-6f4b5bb6.md
Specifies whether a property takes part in audit.
Namespace : DevExpress.Persistent.Base
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public class UseInAuditTrailAttribute :
Attribute
<AttributeUsage(AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple:=False)>
Public Class UseInAuditTrailAttribute
Inherits Attribute
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.
The Audit Trail Module logs changes in the following objects and properties:
Read-only properties (those without a setter) and properties decorated with the NonPersistentAttribute are excluded 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; }
[UseInAuditTrail(false)]
public string MyPersistentProperty {
get { return myPersistentProperty; }
set { SetPropertyValue(nameof(MyPersistentProperty), ref myPersistentProperty, value); }
}
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; }
[UseInAuditTrail(true)]
[NonPersistent]
public string MyNonPersistentProperty {
get { return myNonPersistentProperty; }
set { SetPropertyValue(nameof(MyNonPersistentProperty), ref myNonPersistentProperty, value); }
}
Object Attribute UseInAuditTrailAttribute
See Also