Uniphar.Platform.Common 1.0.12

dotnet add package Uniphar.Platform.Common --version 1.0.12
                    
NuGet\Install-Package Uniphar.Platform.Common -Version 1.0.12
                    
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.12" />
                    
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.12" />
                    
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.12
                    
#r "nuget: Uniphar.Platform.Common, 1.0.12"
                    
#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.12
                    
#: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.12
                    
Install as a Cake Addin
#tool nuget:?package=Uniphar.Platform.Common&version=1.0.12
                    
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.

KV management

Uniphar uses 2 kv's per domain, to do app segregation you can use this:

 builder.Configuration.AddUniKeyVault("frontgate", "platform", builder.Environment.EnvironmentName, creds); // eg dev

It will do 3 things, setup the keyvault, authenticated with the TokenCredential provided, grab both all common--- and frontgate--- prefixed keyvault, and transforms configs the same way as usual AddAzureKeyVault does.

By default every common--- secret is loaded. To load only the common secrets you need, use ExcludeCommon() followed by fluent adds:

 builder.Configuration.AddUniKeyVault("frontgate", "platform", builder.Environment.EnvironmentName, creds, o => o
    .ExcludeCommon()
    .AddCommonCosmos($"uni-devops-{env}")      // common---uni-devops-{env}-cosmos-access-key
    .AddCommonPwPush("my-api")                 // common---my-api-pw-push-auth-token
    .AddCommonSecret("some-other-secret"));    // common---some-other-secret

Secrets prefixed with the app name (frontgate---) are always loaded. AddCommonSecret is the generic add (the common--- prefix is added for you); AddCommonCosmos and AddCommonPwPush are helpers on top of it.

For IntegrationTests:

 builder
    .Configuration
    .AddIntegrationTestsUniKeyVault("frontgate", "platform", builder.Environment.EnvironmentName, creds); // eg dev

This additionally loads all secrets from the integration Key Vault.

During migration, apps still on the shared legacy vault (uni-devops-app-{env}-kv) can use AddUniOldKeyvault(app, domain, env, creds) / AddIntegrationTestOldUniKeyvault(app, domain, env, creds) (same signature as the new methods, to ease the move). They use the standard -- delimiter and reload every 24h. The optional configure argument is accepted for signature parity but ignored, as the legacy vault has no prefixes and is always loaded in full. Remove once migrated.

For integration tests, AddIntegrationTestsUniKeyVault honours configure for the default vault (e.g. ExcludeCommon()), while the integration vault is always loaded in full.

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.12 500 10/28/2026
1.0.11 189 10/22/2026
1.0.10 773 9/18/2026
1.0.9 603 9/1/2026
1.0.8 1,550 5/5/2026
1.0.7 129 5/5/2026
1.0.5 993 12/30/2025
1.0.4 153 12/30/2025
1.0.3.1 150 12/30/2025