EasyConcurrency.Abstractions
0.2.2
dotnet add package EasyConcurrency.Abstractions --version 0.2.2
NuGet\Install-Package EasyConcurrency.Abstractions -Version 0.2.2
<PackageReference Include="EasyConcurrency.Abstractions" Version="0.2.2" />
<PackageVersion Include="EasyConcurrency.Abstractions" Version="0.2.2" />
<PackageReference Include="EasyConcurrency.Abstractions" />
paket add EasyConcurrency.Abstractions --version 0.2.2
#r "nuget: EasyConcurrency.Abstractions, 0.2.2"
#:package EasyConcurrency.Abstractions@0.2.2
#addin nuget:?package=EasyConcurrency.Abstractions&version=0.2.2
#tool nuget:?package=EasyConcurrency.Abstractions&version=0.2.2
EasyConcurrency.Abstractions
EasyConcurrency.Abstractions project provides the essential classes and interfaces that form the foundation of the implementation.
ConcurrentEntity
Solution for optimistic concurrency. Contains only Version property.
When we fetch the (original) Version property, it already has value. If we make changes to this entity, Version also changes.
If the value in data source equals our original value, the changes are saved. If the original value differs from the value that the data source has, an exception is raised and changes are not saved.
Pessimistic Concurrency Control
TimeLock
TimeLock is a custom value type that wraps around DateTimeOffset. The TimeLock is locked for a given duration until it naturally expires,
or is unlocked / released before that can happen.
It provides functionality to manipulate with time until which the TimeLock should be locked, such as:
IsNotLocked - for checking if this TimeLock is not locked
SetLock - for setting the date and time until which the entity is locked. When the lock naturally expires,
the entity will be automatically unlocked.
Unlock - for unlocking the time lock before it naturally expires.
E.g. we have locked an entity to do write operations on it, but are finished.
We can unlock the TimeLock so that other processes can claim it for write changes.
LockableEntity
LockableEntity is an entity that has a TimeLock and inherits from ConcurrentEntity. This entity is what you would store in database.
This is the entity you'd want to lock
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EasyConcurrency.Abstractions:
| Package | Downloads |
|---|---|
|
EasyConcurrency.EntityFramework
EasyConcurrency.EntityFramework is designed to simplify the implementation of concurrency control in Entity Framework. Entity Framework doesn't provide built-in support for pessimistic concurrency, but EasyConcurrency fills this gap by offering an easy-to-use interface. |
GitHub repositories
This package is not used by any popular GitHub repositories.