SplatDev.Routing 2.0.0

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

SplatDev.Routing

Convention-based route registration helpers for ASP.NET Core applications.

What it provides

  • IRoute — interface for declaring conventional MVC routes:

    • RouteAlias — unique route name
    • Url — route pattern (must not start with /)
    • Controller — target controller name
    • Action — target action name
    • Defaults — optional route defaults (anonymous object)
  • IUmbracoPluginRoute — extends IRoute with Umbraco-specific metadata:

    • RootId — Umbraco content node root ID
    • RootAlias — Umbraco content node root alias
    • IsPluginController — marks the route as a plugin controller
  • RouteServiceExtensions.MapSplatDevRoutes — scans caller-provided assemblies for IRoute implementations and registers each as a conventional MVC route. Uses ActivatorUtilities.CreateInstance for DI support on route ctors.

Install

dotnet add package SplatDev.Routing

Usage

// 1. Implement IRoute
public class HomeRoute : IRoute
{
    public string RouteAlias => "home";
    public string Url => "";
    public string Controller => "Home";
    public string Action => "Index";
    public object Defaults => null;
}

// 2. Register in Program.cs / Startup.cs
app.UseEndpoints(endpoints =>
{
    endpoints.MapSplatDevRoutes(typeof(HomeRoute).Assembly);
});

For Umbraco plugin routes, implement IUmbracoPluginRoute : IRoute instead.

Limitations

  • Routes must be registered via the Microsoft.AspNetCore.Mvc pipeline (MapControllerRoute).
  • All-assemblies scan is not supported — callers must explicitly provide the target assemblies.

Design decisions

  • Interface split (v1.1.0): RootId, RootAlias, and IsPluginController were moved from IRoute to IUmbracoPluginRoute : IRoute to keep the base interface free of Umbraco-specific fields.
  • DI on ctors: Activator.CreateInstance was replaced with ActivatorUtilities.CreateInstance (requires IServiceProvider from IEndpointRouteBuilder).

Target frameworks

Framework
net8.0
net10.0

SplatDev.Routing — part of the SplatDev.Umbraco.Plugins suite. Licensed under MIT. © SplatDev Ltda.

Changelog

2.0.0 — 2026-08-25

Breaking. RootId, RootAlias and IsPluginController move off IRoute and onto a new IUmbracoPluginRoute : IRoute. They only ever meant anything for routes served by an Umbraco plugin controller, but sat on the base interface, so every route had to implement three members it did not use. A route that needs them now implements IUmbracoPluginRoute; one that does not is unchanged apart from dropping the three stubs.

Route discovery is unaffected — MapSplatDevRoutes scans for IRoute, and IUmbracoPluginRoute derives from it, so both kinds are still found.

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 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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
2.0.0 100 8/25/2026