ActDim.Practix.Common 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package ActDim.Practix.Common --version 1.0.4
                    
NuGet\Install-Package ActDim.Practix.Common -Version 1.0.4
                    
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="ActDim.Practix.Common" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ActDim.Practix.Common" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="ActDim.Practix.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 ActDim.Practix.Common --version 1.0.4
                    
#r "nuget: ActDim.Practix.Common, 1.0.4"
                    
#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 ActDim.Practix.Common@1.0.4
                    
#: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=ActDim.Practix.Common&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=ActDim.Practix.Common&version=1.0.4
                    
Install as a Cake Tool

ActDim.Practix.Common

ActDim.Practix.Common provides shared utilities, concurrent collection factories, caching proxies, compression helpers, memory buffer management, and Microsoft Dependency Injection extensions for the ActDim.Practix framework.

Features

  • Ambient Context Management: AmbientContext and AmbientContextProvider for managing ambient variable states across asynchronous execution flows (AsyncLocal<T>).
  • Caching Proxies: MemoryCachingProxy and DistributedCachingProxy offering simplified, resilient access to IMemoryCache and IDistributedCache.
  • Stream & Payload Compression: CompressionManager for GZip, BZip2, and ZLib buffer/stream compression.
  • High-Performance Collections: ConcurrentFactoryDictionary (thread-safe lock-free lookup/factory pattern), WeakTable<K, V>, and CompositeKey.
  • Memory Buffer Pooling: Zero-allocation buffer management with ArrayPoolBufferOwner and MemoryManager.
  • Utility & Type Extensions: Extension methods for Encoding, ArraySegment, Stream, String, Enumerable, Task, and Guard clauses.
  • Granular Microsoft DI Extensions: Modular registration helpers (AddAmbientContext(), AddCompressionManager(), AddMemoryCachingProxy(), AddDistributedCachingProxy()).

Installation

Install via the .NET CLI:

dotnet add package ActDim.Practix.Common

Or via Package Manager Console:

Install-Package ActDim.Practix.Common

Dependency Injection Setup

Register components with Microsoft Dependency Injection (IServiceCollection):

using ActDim.Practix.Common.Extensions;
using Microsoft.Extensions.DependencyInjection;

public void ConfigureServices(IServiceCollection services)
{
    // Register ambient context provider
    services.AddAmbientContext();

    // Register compression manager
    services.AddCompressionManager();

    // Register memory and distributed caching proxies
    services.AddMemoryCachingProxy();
    services.AddDistributedCachingProxy();
}

Quick Start Examples

1. Concurrent Factory Dictionary

using ActDim.Practix.Collections.Concurrent;

var cache = new ConcurrentFactoryDictionary<string, UserProfile>(
    key => FetchUserProfileFromDatabase(key),
    StringComparer.OrdinalIgnoreCase
);

// Returns existing item or executes factory thread-safely
UserProfile profile = cache.GetOrAdd("user_42");

2. Compression Manager

using ActDim.Practix.Abstractions.Compression;
using ActDim.Practix.Common.Extensions;
using Microsoft.Extensions.DependencyInjection;

var compression = serviceProvider.GetRequiredService<ICompressionManager>();

byte[] originalData = System.Text.Encoding.UTF8.GetBytes("Payload data to compress");
byte[] compressedData = compression.Compress(originalData, CompressionFormat.GZip);
byte[] decompressedData = compression.Decompress(compressedData, CompressionFormat.GZip);

3. Ambient Context

using ActDim.Practix.Abstractions.Context;
using ActDim.Practix.Common.Extensions;
using Microsoft.Extensions.DependencyInjection;

var contextProvider = serviceProvider.GetRequiredService<IAmbientContextProvider>();
var context = contextProvider.Current;

using (context.PushProperty("TenantId", "acme_corp"))
{
    // Operation logic executing inside tenant context
}

Testing & Quality

  • Test Suite: ActDim.Practix.Common.Tests
  • Total Tests: 213 passed (100% success rate, 0 failed, 0 skipped)
  • Target Framework: .NET 10.0
dotnet test Tests/Common.Tests/ActDim.Practix.Common.Tests.csproj

License

This project is licensed under the MIT License.

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 (3)

Showing the top 3 NuGet packages that depend on ActDim.Practix.Common:

Package Downloads
ActDim.Observability

OpenTelemetry-centric observability and ambient telemetry context framework for .NET applications.

ActDim.Reflectron

High-performance reflection engine providing compiled expression tree property getters, setters, and object accessors.

ActDim.Practix.Json

High-performance JSON serialization subsystem for ActDim.Practix backed by System.Text.Json.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.10 73 8/26/2026
1.0.9 96 8/25/2026
1.0.8 95 8/25/2026
1.0.7 120 8/20/2026
1.0.6 122 8/19/2026
1.0.5 118 8/19/2026
1.0.4 121 8/19/2026
1.0.3 118 8/18/2026
1.0.2 118 8/18/2026
1.0.1 115 8/17/2026
1.0.0 111 8/17/2026