Goodrouter 1.0.6

dotnet add package Goodrouter --version 1.0.6                
NuGet\Install-Package Goodrouter -Version 1.0.6                
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.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Goodrouter --version 1.0.6                
#r "nuget: Goodrouter, 1.0.6"                
#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.
// Install Goodrouter as a Cake Addin
#addin nuget:?package=Goodrouter&version=1.0.6

// Install Goodrouter as a Cake Tool
#tool nuget:?package=Goodrouter&version=1.0.6                

GoodRouter, .NET edition

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. 
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 538 11/7/2023
1.0.0 682 3/10/2023
0.3.6 648 3/9/2023
0.2.0 704 2/5/2023
0.1.3 667 2/1/2023
0.1.2 682 2/1/2023
0.1.1 636 2/1/2023
0.1.0 631 1/31/2023
0.0.19 669 1/29/2023
0.0.18 681 1/29/2023
0.0.17 714 1/29/2023
0.0.16 691 1/29/2023
0.0.15 671 1/29/2023
0.0.14 642 1/29/2023
0.0.12 668 1/28/2023
0.0.10 655 1/28/2023
0.0.9 679 1/28/2023
0.0.8 651 1/28/2023
0.0.7 711 1/27/2023
0.0.5 701 1/27/2023
0.0.1 740 1/27/2023