using Connected.Entities.Annotations; using Connected.Entities.Consistency; namespace Connected.Entities.Concurrency; public abstract record ConcurrentEntity : ConsistentEntity, IConcurrentEntity where TPrimaryKey : notnull { private int _sync = 0; [Persistence(Persistence = ColumnPersistence.InMemory)] public int Sync { get => _sync; set => Interlocked.Exchange(ref _sync, value); } }