Raptor.Common 0.0.10

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

Common Library (Raptor.Common)

NuGet Version

Reusable library for building clean, decoupled, and resilient APIs on .NET 8.

Overview

This package provides:

  • Result modeling (Result, SuccessResult, FailureResult)
  • Error wrappers (BusinessRuleException, ErrorList)
  • Clean Architecture interfaces (IInteractor, IPresenter, IResponse, etc.)
  • Centralized HTTP client (HttpApiClient)
  • Logging extensions for Serilog + Seq

Installation

Install from NuGet:

dotnet add package Raptor.Common

Or add to your .csproj:

<PackageReference Include="Raptor.Common" Version="x.y.z" />

Replace x.y.z with the latest version from NuGet.

Requirements

  • .NET 8 SDK (net8.0)
  • Compatible with ASP.NET Core, domain libraries, and microservices

Project structure (updated paths)

The library now lives at Common/ (previous nested paths were flattened).

Common/                      core library
  CleanArch/                 clean architecture abstractions
  Infra/HttpApi/             HTTP API client and responses
  Logging/                   Serilog + Seq extensions
  Users/                     sample user domain helpers
Common.Tests/                tests
Common.sln                   solution
Common/version               version source for packaging

Usage

Result modeling

using Common;

Result<string> ok = Result.OK("All good");
Result<string> error = Result.Fail<string>("Something went wrong");

Clean Architecture interactor

using Common;
using Common.CleanArch;

public class GetUserInteractor : IResultInteractor<GetUserRequest, UserDto>
{
    public Task<Result<UserDto>> Handle(GetUserRequest request, CancellationToken cancellationToken)
    {
        if (request.Id <= 0)
            return Task.FromResult(Result.Fail<UserDto>("Invalid ID"));

        var user = new UserDto { Id = request.Id, Name = "Example" };
        return Task.FromResult(Result.OK(user));
    }
}

Centralized HTTP client

using Common.Infra.HttpApi;

var client = new HttpApiClient("https://api.example.com/");
var response = await client.GetAsync<MyResponse>("endpoint");

Logging (Serilog + Seq)

appsettings.json:

"CustomLogging": {
  "Project": "MyApiProject",
  "SeqUri": "http://localhost:5341",
  "LogEventLevel": "Information"
}

Registration:

using Common.Logging;

builder.Services.AddLoggingServices(configuration);

Versioning and releases

  • PackageId: Raptor.Common
  • Version source: Common/version (used by Common/Common.csproj)
  • Recommended tags: vX.Y.Z (matching the NuGet package version)

Release checklist

  1. Update Common/version and CHANGELOG.md.
  2. Run dotnet test Common.sln.
  3. Run dotnet pack Common/Common.csproj -c Release.
  4. Tag the commit: git tag vX.Y.Z.
  5. Push branch and tags.

Git flow (adjusted)

  • main: stable, published code
  • develop: integration branch
  • feature/*: new work
  • fix/* or hotfix/*: urgent fixes
  • legacy/*: legacy snapshots (for example legacy/common-legacy)
  • Release tags: vX.Y.Z

Contributions

This is an internal package. Issues and PRs are welcome for improvements.

License

MIT (per package metadata).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
0.0.10 166 12/24/2025
0.0.5 202 4/22/2025
0.0.4 203 4/21/2025