You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
444 B
18 lines
444 B
using Connected.Entities.Annotations;
|
|
using Connected.Entities.Consistency;
|
|
|
|
namespace Connected.Entities.Concurrency;
|
|
|
|
public abstract record ConcurrentEntity<TPrimaryKey> : ConsistentEntity<TPrimaryKey>, IConcurrentEntity<TPrimaryKey>
|
|
where TPrimaryKey : notnull
|
|
{
|
|
private int _sync = 0;
|
|
|
|
[Persistence(Persistence = ColumnPersistence.InMemory)]
|
|
public int Sync
|
|
{
|
|
get => _sync;
|
|
set => Interlocked.Exchange(ref _sync, value);
|
|
}
|
|
}
|