Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

README.md

Nancy.Linker NuGet Status License Build status

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

Installation

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

http://www.horsdal-consult.dk/search/label/Nancy.Linker

On Other Blogs

http://codeopinion.com/nancy-linker-nancyfx-uri-builder/

About

Simple URI builder for named Nancy routes

Resources

License

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  

Languages

You can’t perform that action at this time.