All docs
V20.2
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

AuditTrailService.BeginObjectsAudit(Session, Object[]) Method

Starts auditing the specified objects in Full object auditing mode.

Namespace: DevExpress.Persistent.AuditTrail

Assembly: DevExpress.Persistent.BaseImpl.v20.2.dll

Declaration

public void BeginObjectsAudit(
    Session session,
    params object[] alreadyLoadedObjects
)
Public Sub BeginObjectsAudit(
    session As Session,
    ParamArray alreadyLoadedObjects As Object()
)

Parameters

Name Type Description
session Session

The Session object.

alreadyLoadedObjects Object[]

Objects to be audited.

Remarks

AuditTrailViewController calls this method internally.

The following code demonstrates how to use this method:

using DevExpress.Persistent.AuditTrail;
using DevExpress.Xpo;
// ...
UnitOfWork uow = new UnitOfWork();  
AuditTrailService.Instance.BeginSessionAudit(uow, AuditTrailStrategy.OnObjectChanged, ObjectAuditingMode.Full);  
NestedUnitOfWork nestedUow = uow.BeginNestedUnitOfWork();  
PersistentObject1 obj = new PersistentObject1(nestedUow);  
obj.Property1 = "1";  
obj.Property2 = "2";  
nestedUow.CommitChanges();  
AuditTrailService.Instance.BeginObjectsAudit(uow, nestedUow.GetParentObject(obj));
uow.CommitChanges();  
AuditTrailService.Instance.SaveAuditData(uow);  
See Also