Class AuditScope
- Namespace
- FishMMO.ControlPanel.Services
- Assembly
- FishMMO-ControlPanel.dll
The audit row being built for the current request, which an action may enrich.
public sealed class AuditScope
- Inheritance
-
AuditScope
- Inherited Members
Remarks
AuditActionFilter fills this in from the route and the bound arguments before the action runs, and writes it afterwards. An action that knows something the filter cannot — the name a character had before it was renamed, or which fields an edit actually changed — assigns to it in one line. An action that knows nothing extra assigns nothing and is still recorded.
Scoped per request. It is the reason no controller needs to call an audit method, which is the reason no controller can forget to.
Properties
Action
The stable action identifier. Set from the attribute; rarely overridden.
public string Action { get; set; }
Property Value
Details
Structured detail of what changed. Serialized to JSON.
public object Details { get; set; }
Property Value
Outcome
Overrides the outcome text. Left null, the filter derives it from the status code.
public string Outcome { get; set; }
Property Value
Reason
The reason the operator gave. Taken from the request body's Reason property.
public string Reason { get; set; }
Property Value
Record
Whether this request should be recorded at all.
public bool Record { get; set; }
Property Value
Remarks
Set false ONLY for a privileged endpoint that is genuinely a read — the audit-log listing itself is the case, since every read would write a row whose listing is a read. It must never be used to quieten a write.
TargetID
The target's identifier, as text.
public string TargetID { get; set; }
Property Value
TargetName
The target's name as it read at the time.
public string TargetName { get; set; }
Property Value
Remarks
Worth setting for anything whose name can change. A rename recorded under the new name cannot answer "what happened to the character called X", which is the question somebody actually asks.
TargetType
What kind of thing was acted on.
public string TargetType { get; set; }