Interface IVersioned<T>
Marker interface for immutable DTOs that carry a logical version for optimistic concurrency. Implement this interface on any Data transfer object that participates in version-gated persistence.
public interface IVersioned<T> where T : struct, IVersioned<T>
Type Parameters
TThe concrete DTO type (for fluent return types).
Properties
Version
The authoritative logical version. Services use this value to gate writes: only writes with a version greater than the persisted version will succeed.
long Version { get; }
Property Value
Methods
WithVersion(long)
Returns a new instance of this DTO with the specified version. Used by extension methods to create incremented copies.
T WithVersion(long newVersion)
Parameters
newVersionlongThe new version value.
Returns
- T
A new instance with the updated version.