Enum MementoCaptureStrategy
- Namespace
- PatternKit.Generators
- Assembly
- PatternKit.Generators.Abstractions.dll
Defines how a member's value is captured in the memento snapshot.
public enum MementoCaptureStrategy
Fields
ByReference = 0Capture the reference as-is (shallow copy). Safe for immutable types and value types. WARNING: For mutable reference types, mutations will affect all snapshots.
Clone = 1Clone the value using a known mechanism (ICloneable, record with-expression, etc.). Generator emits an error if no suitable clone mechanism is available.
Custom = 3Use a custom capture mechanism provided by the user. Requires the user to implement a partial method for custom capture logic.
DeepCopy = 2Perform a deep copy of the member value. Only available when the generator can safely emit deep copy logic.