Class LegalHold
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Represents an active legal hold.
public sealed record LegalHold : IEquatable<LegalHold>
- Inheritance
-
LegalHold
- Implements
- Inherited Members
Properties
Basis
Gets the legal basis for the hold.
public required LegalHoldBasis Basis { get; init; }
Property Value
CaseReference
Gets the external case reference.
public required string CaseReference { get; init; }
Property Value
CreatedAt
Gets when the hold was created.
public required DateTimeOffset CreatedAt { get; init; }
Property Value
CreatedBy
Gets who created the hold.
public required string CreatedBy { get; init; }
Property Value
DataSubjectIdHash
Gets the SHA-256 hash of the data subject identifier.
public string? DataSubjectIdHash { get; init; }
Property Value
Description
Gets the description.
public required string Description { get; init; }
Property Value
ExpiresAt
Gets when the hold expires.
public DateTimeOffset? ExpiresAt { get; init; }
Property Value
HoldId
Gets the hold identifier.
public required Guid HoldId { get; init; }
Property Value
IdType
Gets the type of identifier.
public DataSubjectIdType? IdType { get; init; }
Property Value
IsActive
Gets whether the hold is currently active.
public required bool IsActive { get; init; }
Property Value
ReleaseReason
Gets the release reason.
public string? ReleaseReason { get; init; }
Property Value
ReleasedAt
Gets when the hold was released.
public DateTimeOffset? ReleasedAt { get; init; }
Property Value
ReleasedBy
Gets who released the hold.
public string? ReleasedBy { get; init; }
Property Value
TenantId
Gets the tenant ID.
public string? TenantId { get; init; }
Property Value
Version
Gets the concurrency token for this hold: the number of times the stored record has been updated.
public int Version { get; init; }
Property Value
Remarks
The store owns this value; a caller only carries it. A newly created hold is stored at
0, GetHoldAsync(Guid, CancellationToken) and the query store return whatever is stored,
and each successful UpdateHoldAsync(LegalHold, CancellationToken) increments it by one. Setting it by
hand does not move the stored record; it only changes which stored version the next update will
accept.
Round-trip it unchanged. Updating a hold is a read-modify-write, and the version is what makes
that sequence safe: the store applies the write only if the record still carries the version the
caller read, and raises LegalHoldConcurrencyException if it does not. Building the
record to write with a with expression over the one that was read carries the version across
for free, which is why no call site needs to mention it. Constructing a fresh
LegalHold from parts and writing that is the way to lose the protection — the version
defaults to 0, which no updated record still carries, so the write is refused rather than
silently applied.
It is a plain counter rather than a provider-native row version or ETag so that every store — the relational providers and the in-memory one — compares the same value and a hold read from one shape of store means the same thing as a hold read from another.