Open sandboxFocus

Struct SuspendInvariantsCookie

A disposable cookie returned by the SuspendInvariants method generated by the InvariantAttribute aspect.

Implements
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public struct SuspendInvariantsCookie : IDisposable
Remarks

When disposed, this struct decrements the suspension counter, potentially re-enabling invariant verification.

Constructors

Name Description
SuspendInvariantsCookie(InvariantSuspensionCounter)

Initializes a new instance of the SuspendInvariantsCookie struct.

Methods

Name Description
Dispose()

Decrements the suspension counter. If the counter reaches zero, invariant verification is re-enabled.

See Also