Skip to main content
All docs
V24.1
.NET 6.0+

AuditTrailEvents.OnCustomCreateAuditDataStore Property

Specifies a delegate method that creates a custom data store for audit trails.

Namespace: DevExpress.ExpressApp.AuditTrail

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

Declaration

public Action<CustomCreateAuditDataStoreContext> OnCustomCreateAuditDataStore { get; set; }

Property Value

Type Description
Action<DevExpress.ExpressApp.AuditTrail.CustomCreateAuditDataStoreContext>

A delegate method that takes the event context object as an argument.

Remarks

Use this property to specify a custom audit data store (an AuditDataStore descendant):

File: MySolution.WebApi\startup.cs (MySolution.Blazor.Server\startup.cs)

builder.Modules
    .AddAuditTrailXpo(options => {
        options.Events.OnCustomCreateAuditDataStore = (context) => {
            context.AuditDataStore = new CustomAuditDataStore();
        };
    })

You can also register the audit trail services directly as the code below demonstrates:

File: MySolution.WebApi\startup.cs (MySolution.Blazor.Server\startup.cs)

services
    .AddAuditTrailXpoServices(options => {
        options.Events.OnCustomCreateAuditDataStore = (context) => {
            context.AuditDataStore = new CustomAuditDataStore();
        };
    })
See Also