VOOZH about

URL: https://www.nuget.org/packages/SOFTURE.Common.Web

⇱ NuGet Gallery | SOFTURE.Common.Web 0.4.0




SOFTURE.Common.Web 0.4.0

dotnet add package SOFTURE.Common.Web --version 0.4.0
 
 
NuGet\Install-Package SOFTURE.Common.Web -Version 0.4.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="SOFTURE.Common.Web" Version="0.4.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SOFTURE.Common.Web" Version="0.4.0" />
 
Directory.Packages.props
<PackageReference Include="SOFTURE.Common.Web" />
 
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 SOFTURE.Common.Web --version 0.4.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SOFTURE.Common.Web, 0.4.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.
#:package SOFTURE.Common.Web@0.4.0
 
 
#: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=SOFTURE.Common.Web&version=0.4.0
 
Install as a Cake Addin
#tool nuget:?package=SOFTURE.Common.Web&version=0.4.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SOFTURE

👁 NuGet
👁 .NET

A collection of reusable .NET libraries providing common infrastructure for building distributed, observable, and resilient microservices. Each module is published as an independent NuGet package and can be adopted incrementally.

Packages

Package Description
SOFTURE.Common.Authentication JWT Bearer authentication setup and configuration
SOFTURE.Common.CQRS CQRS middleware and validation behaviors for MediatR pipelines
SOFTURE.Common.Correlation Request correlation ID tracking for distributed tracing
SOFTURE.Common.HealthCheck Health check framework with standardized response format
SOFTURE.Common.Logging Structured logging with Serilog and Seq integration
SOFTURE.Common.Observability OpenTelemetry tracing and metrics (Prometheus, OTLP)
SOFTURE.Common.Resilience HTTP resilience policies — retry, circuit breaker, hedging, fallback
SOFTURE.Common.StronglyTypedIdentifiers Strongly-typed ID abstractions with EF Core and FastEndpoints support
SOFTURE.Common.Web Web application bootstrap helpers — culture enforcement and data protection keys persistence
SOFTURE.MessageBroker.Rabbit RabbitMQ message publishing and consuming via MassTransit

Getting Started

Prerequisites

Installation

Install the packages you need via NuGet:

dotnet add package SOFTURE.Common.Authentication
dotnet add package SOFTURE.Common.CQRS
dotnet add package SOFTURE.Common.Correlation
dotnet add package SOFTURE.Common.HealthCheck
dotnet add package SOFTURE.Common.Logging
dotnet add package SOFTURE.Common.Observability
dotnet add package SOFTURE.Common.Resilience
dotnet add package SOFTURE.Common.StronglyTypedIdentifiers
dotnet add package SOFTURE.Common.Web
dotnet add package SOFTURE.MessageBroker.Rabbit

Usage

All modules integrate through IServiceCollection extension methods in your Program.cs or Startup.cs.

Authentication

Configures JWT Bearer authentication with symmetric key signing.

services.AddCommonAuthentication<AppSettings>();

Your settings class must implement IAuthenticationSettings and provide:

  • JwtSecret — symmetric signing key
  • ValidAudience — expected token audience
  • ValidIssuer — expected token issuer

CQRS

Registers MediatR pipeline behaviors for automatic command validation using FluentValidation.

services.AddMiddlewares();

Logging

Sets up Serilog with console output and Seq sink. Automatically registers a Seq health check.

services.AddCommonLogging<AppSettings>();

Your settings class must implement ISeqSettings and provide:

  • Url — Seq server endpoint
  • ApiKey — Seq API key

Observability

Configures OpenTelemetry with ASP.NET Core, HttpClient, EF Core, and Npgsql instrumentation. Exports metrics via Prometheus and traces via OTLP.

services.AddCommonObservability<AppSettings>();

// In the pipeline:
app.UseCommonOpenTelemetry();

Your settings class must implement IObservabilitySettings and provide:

  • Url — OTLP collector endpoint

Resilience

Registers a named resilience pipeline ("retry") with hedging, fallback, retry (exponential backoff with jitter), and circuit breaker strategies.

services.AddCommonResilience();

Usage in application code:

// Inject ResiliencePipelineProvider<string>
var pipeline = pipelineProvider.GetPipeline<HttpResponseMessage>("retry");
var response = await pipeline.ExecuteAsync(
 async token => await httpClient.GetAsync("https://api.example.com", token), ct);

Correlation

Registers a scoped correlation ID provider for request tracking across services.

services.AddCommonCorrelationProvider();

Health Checks

Registers custom health checks with a standardized /hc endpoint.

services.AddCommonHealthCheck<MyCustomHealthCheck>();

// In the pipeline:
app.MapCommonHealthChecks();

Health check classes must extend CheckBase and implement ICommonHealthCheck.

Message Broker (RabbitMQ)

Configures MassTransit with RabbitMQ for publishing and consuming messages. Includes in-memory outbox, correlation logging filters, and automatic consumer discovery.

Publisher:

services.AddCommonPublisher<AppSettings>();

Consumer:

services.AddCommonConsumers<AppSettings>(
 assembly: typeof(Program).Assembly,
 retryCount: 3,
 prefetchCount: 50,
 exponentialRetry: true);

Your settings class must implement IRabbitSettings and provide:

  • Url — RabbitMQ connection URL
  • Name — queue name (consumers only)

Consumer classes are discovered automatically — any non-abstract class implementing IConsumer<IMessage> or IConsumer<IBulkMessage> in the provided assembly will be registered.

Strongly Typed Identifiers

Provides type-safe entity identifiers with EF Core value converters and JSON serialization support for FastEndpoints.

EF Core configuration (in DbContext):

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
 configurationBuilder.ConfigureStronglyIdentifiers<LanguageAssemblyMarker>();
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
 modelBuilder.ConfigureStronglyIdentifiers();
}

JSON serialization:

jsonOptions.RegisterStronglyTypedIdConverters<LanguageAssemblyMarker>();

Supports Guid, int, and long identifier value types.

Web

Bootstrap helpers for ASP.NET Core applications — globally enforces a culture and persists Data Protection keys to disk.

Culture enforcement:

services.AddCommonCulture(new CultureInfo("pl-PL"));

// In the pipeline (web APIs only — applies the enforced culture to every request):
app.UseRequestLocalization();

Sets CultureInfo.DefaultThreadCurrentCulture / DefaultThreadCurrentUICulture and restricts RequestLocalizationOptions to the provided culture as the single supported one — requests with Accept-Language mismatches fall back to the enforced culture.

Data Protection keys persistence:

services.AddCommonDataProtection("/tmp/dataprotection-keys");

Persists the ASP.NET Core Data Protection key ring to the given filesystem path — required for containerized deployments where keys must survive restarts and be shared across instances.

Request context logging middleware:

// In the pipeline:
app.UseCommonRequestContextLogging();

Reads the X-Correlation-ID header (or generates one), stores it in ICorrelationProvider, and enriches Serilog LogContext with a CorrelationId property for the duration of the request. Requires SOFTURE.Common.Correlation (transitive) and Serilog for log enrichment.

Supported Frameworks

Framework Status
.NET 6.0 Supported
.NET 8.0 Supported
.NET 9.0 Supported
.NET 10.0 Supported

Contributing

Contributions are welcome! To get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

Building locally

cd API
dotnet restore
dotnet build

Releasing

Each package has its own GitHub Actions workflow. To release a new version:

  1. Create a GitHub Release with a version tag (e.g., 1.0.0)
  2. The corresponding workflow will pack and push the package to NuGet.org

License

This project is licensed under the MIT License — see the file for details.

Product Versions Compatible and additional computed target framework versions.
.NET net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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
0.4.0 418 4/19/2026