Voyager.Common.Proxy.Server.Core 1.7.7

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

Voyager.Common.Proxy.Server.Core

Core logic for service scanning, endpoint metadata building, and request dispatching.

Overview

This package contains the shared implementation used by both Voyager.Common.Proxy.Server.AspNetCore and Voyager.Common.Proxy.Server.Owin to transform service interfaces into HTTP endpoints.

Key Types

  • ServiceScanner - Scans service interfaces and builds endpoint descriptors using the same routing conventions as Voyager.Common.Proxy.Client
  • RequestDispatcher - Invokes service methods based on HTTP requests and writes responses
  • RequestValidator - Validates request parameters before method execution
  • ParameterBinder - Binds request parameters from route values, query strings, and request body
  • EndpointMatcher - Matches incoming HTTP requests to registered endpoints

Routing Conventions

The scanner uses the same conventions as the client library:

Method Prefix HTTP Method Route Template
Get, Find, Search GET /{ServiceName}/{MethodName}/{id?}
Create, Add, Insert POST /{ServiceName}/{MethodName}
Update, Modify, Set PUT /{ServiceName}/{MethodName}/{id}
Delete, Remove DELETE /{ServiceName}/{MethodName}/{id}
Other POST /{ServiceName}/{MethodName}

Usage

This package is typically not used directly. Instead, use one of the platform-specific packages:

  • ASP.NET Core (.NET 6.0+): Voyager.Common.Proxy.Server.AspNetCore
  • OWIN (.NET Framework 4.8): Voyager.Common.Proxy.Server.Owin

Error Type to HTTP Status Code Mapping

According to ADR-007, Result<T>.Error types are mapped to HTTP status codes:

ErrorType HTTP Status Classification
Validation 400 Bad Request Business
Business 400 Bad Request Business
Unauthorized 401 Unauthorized Business
Permission 403 Forbidden Business
NotFound 404 Not Found Business
Conflict 409 Conflict Business
Cancelled 499 Client Closed Business
Timeout 504 Gateway Timeout Transient
Unavailable 503 Service Unavailable Transient
CircuitBreakerOpen 503 Service Unavailable Transient
Database 500 Internal Server Error Infrastructure
Unexpected 500 Internal Server Error Infrastructure

Classification meaning:

  • Business errors: Client should NOT retry (invalid input, not found, no permission)
  • Transient errors: Client MAY retry (temporary unavailability)
  • Infrastructure errors: Client should NOT retry, but circuit breaker should count

Server-to-Server Calls

When your server needs to call other services, use Voyager.Common.Proxy.Client with built-in resilience:

// In your server's Startup/Program.cs
services.AddServiceProxy<IPaymentService>(options =>
{
    options.BaseUrl = new Uri("https://payments.internal.com");
    options.Resilience.Retry.Enabled = true;
    options.Resilience.CircuitBreaker.Enabled = true;
});

See Voyager.Common.Proxy.Client for details.

Request Validation

The RequestDispatcher supports automatic validation of request parameters when [ValidateRequest] attribute is present on the method or interface.

How It Works

  1. Before invoking the service method, RequestValidator checks all parameters
  2. Parameters implementing IValidatableRequest or IValidatableRequestBool are validated
  3. Parameters with [ValidationMethod] attribute have that method invoked
  4. On validation failure, ArgumentException is thrown and caught by existing error handling
  5. HTTP 400 response is returned with ErrorType="Validation"

Validation Flow

HTTP Request
    │
    ▼
RequestDispatcher
    │
    ├─► Deserialize parameters
    │
    ├─► Check [ValidateRequest] attribute
    │     │
    │     └─► RequestValidator.ValidateParameters()
    │           │
    │           ├─ IValidatableRequest.IsValid() → Result
    │           ├─ IValidatableRequestBool.IsValid() → bool
    │           └─ [ValidationMethod] → Result or bool
    │
    ├─► On failure: throw ArgumentException
    │     │
    │     └─► HTTP 400 + ErrorType="Validation"
    │
    └─► On success: Invoke service method

Supported Validation Approaches

Approach Detection Performance
IValidatableRequest Interface cast Fast
IValidatableRequestBool Interface cast Fast
[ValidationMethod] Reflection Slower

Example

// Service interface with validation
[ValidateRequest]
public interface IPaymentService
{
    Task<Result<Payment>> CreatePaymentAsync(CreatePaymentRequest request);
}

// Request model with validation
public class CreatePaymentRequest : IValidatableRequest
{
    public decimal Amount { get; set; }
    public string Currency { get; set; }

    public Result IsValid()
    {
        if (Amount <= 0)
            return Result.Failure(Error.ValidationError("Amount must be positive"));
        if (string.IsNullOrEmpty(Currency))
            return Result.Failure(Error.ValidationError("Currency is required"));
        return Result.Success();
    }
}

When an invalid request is received, the response will be:

HTTP 400 Bad Request
ErrorType: Validation
ErrorMessage: Amount must be positive

Target Framework

  • netstandard2.0 - Compatible with .NET Framework 4.6.1+, .NET Core 2.0+, and .NET 5+
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 Voyager.Common.Proxy.Server.Core:

Package Downloads
Voyager.Common.Proxy.Server.Swagger.Core

Core logic for Swagger/OpenAPI generation from Voyager.Common.Proxy service interfaces. Shared between ASP.NET Core and OWIN implementations.

Voyager.Common.Proxy.Server.AspNetCore

ASP.NET Core integration for Voyager.Common.Proxy.Server - automatically generates HTTP endpoints from service interfaces.

Voyager.Common.Proxy.Server.Owin

OWIN integration for Voyager.Common.Proxy.Server - automatically generates HTTP endpoints from service interfaces for .NET Framework 4.8. Uses raw OWIN delegate signatures for maximum compatibility.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.0-preview 0 2/10/2026
1.7.8-preview.1 27 2/9/2026
1.7.7 54 2/6/2026
1.7.7-preview.1.1 30 2/6/2026
1.7.7-preview 0 2/10/2026