Uniphar.Platform.Common 1.0.5

dotnet add package Uniphar.Platform.Common --version 1.0.5
                    
NuGet\Install-Package Uniphar.Platform.Common -Version 1.0.5
                    
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="Uniphar.Platform.Common" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Uniphar.Platform.Common" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Uniphar.Platform.Common" />
                    
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 Uniphar.Platform.Common --version 1.0.5
                    
#r "nuget: Uniphar.Platform.Common, 1.0.5"
                    
#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 Uniphar.Platform.Common@1.0.5
                    
#: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=Uniphar.Platform.Common&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Uniphar.Platform.Common&version=1.0.5
                    
Install as a Cake Tool

platform-dotnet-common

This repository contains common libraries and utilities for .NET applications used across various projects within the organization.

Locking across regions

Distributed locking allows for coordination between different regions/application instances to ensure that certain operations are performed in a mutually exclusive manner.

This is particularly useful - given Uniphar tech stack - to run dapr based applications in multiple regions

Internal application uses Cosmos document to record lock status and job assignments. Job is simply an id for the operation that is being performed and requires locking.

Locks are periodically renewed and assignments periodically refreshed to ensure that they remain valid and rebalanced. Configuration is provided via DistributedLockServiceOptions.

Usage

To instrument the locking in the app, service collection and service provider extension methods have been provided.

 builder.Services.AddCosmosLockService("cosmos-connection-string");

Then as you build the app, you can initialize the lock service

await app.Services.InitializeDistributedLockAsync("region-designation", "cosmos-database-name", "cosmos-collection-name");

Once initialized, you can use the DistributedLockService to acquire and release locks. For example:

bool lockAcquired = await dls.AcquireJobLockAsync(context.JobId);

if (lockAcquired)
{ 
    //lock acquired, proceed with job processing
}
else
{
    // Failed to acquire the lease, another instance may be processing
}
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

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.5 921 12/30/2025
1.0.4 112 12/30/2025
1.0.3.1 112 12/30/2025