Skip storing "Target"."Old" and "Environment" in the underlying store. #525
-
Is there any way to narrow dataset stored in underlying store ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
One option is to set up a Custom Action to remove the data you don't need, for example: Audit.Core.Configuration.AddOnSavingAction(scope =>
{
scope.Event.Environment = null;
if (scope.Event.Target?.Old != null)
{
scope.Event.Target.Old = null;
}
}); If you are not using Target.Old, maybe it's better to just use a Custom Field, for example to create a field named "Order": using var scope = AuditScope.Create("Event Type", null, new { Order = order }); or using var scope = AuditScope.Create("Event Type", null);
scope.SetCustomField("Order", order); |
Beta Was this translation helpful? Give feedback.
One option is to set up a Custom Action to remove the data you don't need, for example:
If you are not using Target.Old, maybe it's better to just use a Custom Field, for example to create a field named "Order":
or