Viaduct.Core
0.1.1
dotnet add package Viaduct.Core --version 0.1.1
NuGet\Install-Package Viaduct.Core -Version 0.1.1
<PackageReference Include="Viaduct.Core" Version="0.1.1" />
<PackageVersion Include="Viaduct.Core" Version="0.1.1" />
<PackageReference Include="Viaduct.Core" />
paket add Viaduct.Core --version 0.1.1
#r "nuget: Viaduct.Core, 0.1.1"
#:package Viaduct.Core@0.1.1
#addin nuget:?package=Viaduct.Core&version=0.1.1
#tool nuget:?package=Viaduct.Core&version=0.1.1
Viaduct.Core
Define your service interface once. Viaduct wires it to an ASP.NET Core server and a typed HTTP client — automatically, at compile time, with no duplication.
Viaduct.Core is the foundation package. It contains the attributes and shared types that belong on your interface definition project — the shared contract that both the server and the client depend on.
It has no dependency on ASP.NET Core or HttpClient, keeping your contract project lean.
The single-source-of-truth model
┌─────────────────────────────────────────┐
│ Shared project (references Viaduct.Core)│
│ │
│ [BasePath("/users")] │
│ public interface IUserService │
│ { │
│ Task<User> GetUserAsync(int id); │
│ Task CreateUserAsync(string name); │
│ } │
└────────────┬────────────────────────────┘
│ same interface
┌───────┴───────┐
▼ ▼
Server project Client project
Viaduct.Server Viaduct.Client
(maps endpoints) (generates proxy)
Define the interface once in a shared project. Viaduct.Server reads it and maps Minimal API endpoints. Viaduct.Client reads it and generates a typed HttpClient proxy. Both stay in sync automatically — change the interface and both sides are updated at the next compile.
What's included
- Attributes:
[BasePath],[CustomRoute],[HttpMethodType],[ViaductIgnore],[ViaductIgnoreForServer] - Options:
ViaductOptionsbase record - Exceptions:
ViaductException,MissingRouteParameterException
Example
using Viaduct;
[BasePath("/users")]
public interface IUserService
{
Task<User> GetUserAsync(int id, CancellationToken ct = default);
Task CreateUserAsync(string name, DateTime dateOfBirth);
[ViaductIgnore] // excluded from both server and client
void InternalMethod();
[ViaductIgnoreForServer] // client proxy only, no server endpoint
Task<User> LocalFallbackAsync(int id);
}
The server and client projects reference this interface and add Viaduct.Server / Viaduct.Client to do the actual wiring — no changes to the interface needed.
Which package do I need?
| Your project | Package |
|---|---|
| Defines the shared interface | Viaduct.Core |
| ASP.NET Core server | Viaduct.Server |
| Client / consumer app | Viaduct.Client |
| Needs both (integration tests, monolith) | Viaduct |
Requirements
- .NET 8, 9, or 10
| Product | Versions 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 is compatible. 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 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. |
-
net10.0
- Subro.Json (>= 0.0.1)
-
net8.0
- Subro.Json (>= 0.0.1)
-
net9.0
- Subro.Json (>= 0.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Viaduct.Core:
| Package | Downloads |
|---|---|
|
Viaduct.Server
Server-side runtime for Viaduct. Automatically maps DI service interfaces to ASP.NET Core Minimal API endpoints via the Viaduct source generator. Install this package in your ASP.NET Core server project. |
|
|
Viaduct.Client
Client-side runtime for Viaduct. Automatically generates typed HttpClient proxies from service interfaces via the Viaduct source generator. Install this package in your client or consumer project. |
GitHub repositories
This package is not used by any popular GitHub repositories.