Simple URI builder for named Nancy routes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Nancy.Linker NuGet Status License Build status

Simple URI builder for named Nancy routes with optional pass through of query parameters.


PM> Install-Package Nancy.Linker

General Usage

public class BazModule : NancyModule
  public BazModule(IResourceLinker linker)
    var absoluteLink = linker.BuildAbsoluteUri(this.Context, "aNamedRoute", parameters: new {id = 123})
    var relativeLink = linker.BuildRelativeUri(this.Context, "aNamedRoute", parameters: new {id = 123})

Query Parameter Passthrough Usage

To enable the query parameters pass through filter, bootstrap the PassthroughQueryFilter class. In the code below, the parameter 'foo' will be passed to the build URI from the ResourceLinker.

public class Bootstrapper : DefaultNancyBootstrapper
  protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
    // Other bootstrapper code here  
    container.Register<IQueryFilter>(new PassthroughQueryFilter(new[] { "foo" }));

More information

On My Blog

On Other Blogs