EasyConcurrency.Abstractions 0.2.2

dotnet add package EasyConcurrency.Abstractions --version 0.2.2
                    
NuGet\Install-Package EasyConcurrency.Abstractions -Version 0.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EasyConcurrency.Abstractions" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyConcurrency.Abstractions" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="EasyConcurrency.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasyConcurrency.Abstractions --version 0.2.2
                    
#r "nuget: EasyConcurrency.Abstractions, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EasyConcurrency.Abstractions@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasyConcurrency.Abstractions&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=EasyConcurrency.Abstractions&version=0.2.2
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
0.2.2 190 12/20/2024
0.2.1 162 12/20/2024
0.2.0 169 12/20/2024