Metran 1.0.0

dotnet add package Metran --version 1.0.0
NuGet\Install-Package Metran -Version 1.0.0
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="Metran" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Metran --version 1.0.0
#r "nuget: Metran, 1.0.0"
#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.
// Install Metran as a Cake Addin
#addin nuget:?package=Metran&version=1.0.0

// Install Metran as a Cake Tool
#tool nuget:?package=Metran&version=1.0.0

Metran

Thread-safe transaction manager working in memory

Version

Version kept as low as possible to support older .NET versions

.NET 4.6 or higher

C# 7.0 or higher

What it does ?

Metran provides simple yet useful thread-safe locker

What is the goal ?

Goal is removing load from database or any other source and using ConcurrentBag to determine if given transaction id is processing

By using the "using" keyword you only have to BeginTransaction in metran container by providing an id

This way once you exit out of the method transaction will be automatically disposed and lock will be released

Metran does not do what "lock" keyword does. It does not lock current thread or any thread.

It's purpose is to lock certain users for instance calling same method/endpoint more than once.

Let's say you are going to do some financial database actions and you want user to be able to only call the method once. And if method is in processing you don't want second instance of the method running. Completely avoiding any overlap in db or any other business logic.

Remember this does NOT remove the need to use database transactions. It simply provides a locker with an id (in most cases user id or something else)

How to use ?

You can check the example project

WIP...

Product Compatible and additional computed target framework versions.
.NET Framework net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 163 1/8/2024