Skip to main content
All docs
V24.2
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AuditTrailServiceBase.IsSessionAudited(Session) Method

Indicates whether the Audit Trail Module audits object changes within the specified session.

Namespace: DevExpress.Persistent.BaseImpl.AuditTrail.Services

Assembly: DevExpress.Persistent.BaseImpl.Xpo.v24.2.dll

#Declaration

public bool IsSessionAudited(
    Session session
)

#Parameters

Name Type Description
session Session

The Session object that this method checks.

#Returns

Type Description
Boolean

true if the Audit Trail Module audits object changes in the specified session; otherwise, false.

#Remarks

The following code sample demonstrates how to use this method:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Xpo;
using DevExpress.Persistent.AuditTrail;
using DevExpress.Xpo;
using Microsoft.Extensions.DependencyInjection;

public partial class MyController : ViewController {
    protected override void OnActivated() {
        base.OnActivated();
        Session session = ((XPObjectSpace)ObjectSpace).Session;
        var auditTrailService = Application.ServiceProvider.GetRequiredService<AuditTrailService>();
        if(auditTrailService.IsSessionAudited(session)) {
            auditTrailService.BeginSessionAudit(session,
            AuditTrailStrategy.OnObjectChanged, ObjectAuditingMode.Full);
        }
    }
    // ...
}
See Also