Goodrouter 1.0.0

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

GoodRouter, .NET edition

A good router should:

  • work in a server or a client (or any other) environment
  • be able to construct routes based on their name
  • should have a simple API!
  • not do the actual navigation!
  • be framework agnostic
  • be very minimal and simple!

Check out the website, join our Discord server!

Example:

var router = new Router();

router
    .InsertRoute("all-products", "/product/all")
    .InsertRoute("product-detail", "/product/{id}");

// And now we can parse routes!

{
    var (routeKey, routeParameters) = router.ParseRoute("/not-found");
    Assert.Null(routeKey);
    Assert.Equal(
        new Dictionary<string, string>(),
        routeParameters
    );
}

{
    var (routeKey, routeParameters) = router.ParseRoute("/product/all");
    Assert.Equal("all-products", routeKey);
    Assert.Equal(
        new Dictionary<string, string>(),
        routeParameters
    );
}

{
    var (routeKey, routeParameters) = router.ParseRoute("/product/1");
    Assert.Equal("product_detail", routeKey);
    Assert.Equal(
        new Dictionary<string, string>() {
            {"id", "1"}
        },
        routeParameters
    );
}

// And we can stringify routes

{
    var path = router.StringifyRoute("all-products");
    Assert.Equal("/product/all", path);
}

{
    var path = router.StringifyRoute(
        "product-detail",
        new Dictionary<string, string>() {
            {"id", "2"}
        }
    );
    Assert.Equal("/product/2", path);
}

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.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
1.0.6 593 11/7/2023
1.0.0 734 3/10/2023
0.3.6 695 3/9/2023
0.2.0 763 2/5/2023
0.1.3 717 2/1/2023
0.1.2 732 2/1/2023
0.1.1 689 2/1/2023
0.1.0 683 1/31/2023
0.0.19 724 1/29/2023
0.0.18 733 1/29/2023
0.0.17 767 1/29/2023
0.0.16 745 1/29/2023
0.0.15 727 1/29/2023
0.0.14 697 1/29/2023
0.0.12 723 1/28/2023
0.0.10 708 1/28/2023
0.0.9 732 1/28/2023
0.0.8 703 1/28/2023
0.0.7 760 1/27/2023
0.0.5 771 1/27/2023 0.0.5 is deprecated.
0.0.1 811 1/27/2023 0.0.1 is deprecated.