Table of Contents

Interface IVersioned<T>

Namespace
FishMMO.Database.Data
Assembly
FishMMO-DB.dll

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

T

The 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

long

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

newVersion long

The new version value.

Returns

T

A new instance with the updated version.