Using Nancy.Linker with Views

TL;DR

You have two options: 
  • The simplest is to use Nancy.Linker in your route handler to generate the links needed in the views, put them on the view model and pass the view model to the view as usual. 
  • The other is to pass IResourceLinker to the view and allow it to generate links as needed. For this to work you may need a little bit of web.config'ing to make Razor play nice. 
This post shows the former.

Nothing New

In the last post I introduced Nancy.Linker, showed how to use it to create links to named routes and place them on a model object returned by a Nancy route handler.

In essence; given this module:


This route handler will return a model with a

Read more...

Nancy.Linker

TL;DR

Nancy.Linker is a small library for creating URIs for named routes in Nancy application that I released to NuGet the other day.

Purpose of Nancy.Linker

The problem Nancy.Linker solves is to allow your application code to create URIs pointing to endpoints in your Nancy application without hardcoding the URI. Instead you refer to the endpoint by its route name and provide values for whatever route parameters the route expects. The library then returns you a suitable System.Uri.

Example

Let's consider a Nancy application with this module in it:


The module does nothing interesting, but bear with me. The thing to notice is that FooModule has all sorts of routes - a constant

Read more...

Changing the way we work on GitHub

Being a distributed team, GitHub is our single most important piece of the puzzle that makes up Nancy. With the recent changes in our governance, we felt we needed to make some changes on how we work on GitHub.

Read more...

Nancy hosting, OWIN and ASP.NET vNext

Nancy has always been disconnected from the underlaying host, enabling you to run Nancy on top of ASP.NET, self-hosted, as part of your WCF service, or embedded pretty much wherever you want.

We were also the first full framework to adopt OWIN based hosting, through our Nancy.Hosting.Owin nuget. With the recent 0.23.0 release we moved our OWIN host into the core project as a stepping stone.

Read more...

Nancy moving forward

Recently we had a meeting that was made up of Me, Steven and most of the Most Valued Minions. On the agenda was everything from discussing the governance of the project, to making plans for a v1, looking over the state of our GitHub repository and much more.

A lot of ground was covered and the intention of this blog series is to try and get down as much as possible of what we said and decided. We believe in developing in the open, so it is important that we get the information out to our community.

Please do not hesitate to reach out to us if you have any questions, suggestions and just want to share your thoughts on the subjects!

Here is a tl;dr of the posts

  • Most Valued Minions can

Read more...

One Nancy blog to aggregate them all!

I have been wanting to create a Nancy blog for a very long time. My initial idea was to create a blog that used static files and posts in markdown format (like Sandra.Snow, which is built using Nancy, or Jekyll) and have people submit pull-requests if they wanted to share content.

A lack of time got the better of me and I never got any further than creating an empty repository. The idea never vanished and it has been something that we (the core contributors of Nancy) recently started talking about again.

During our meeting it was brought up again and we thought it was a great idea and that we should act on it. The next day Jonathan Channon shared his first spike of the blog that, behind

Read more...

Our sights are set on releasing v1

Over the years, we have often gotten the question on when we will be releasing v1 of Nancy. While it has never been important to us, many have been claiming that this is something that is important for enterprise adoption.

I still remember when we went from 0.9.0 to 0.10.0 and many thought we were crazy. Apparently 1.0.0 is the obvious next version after 0.9.0, right? With the current release being 0.23.0, you can perhaps tell that we did not agree.

Of course, it is my personal belief, that changing the version number to v1, is just an artificial sense of security. Nothing else is going to change in terms of support or promises (well almost, more about versioning further below).

Read more...

Streamlining our community presence

There as several ways that our community are able to communicate with us and each other

However, we want to make a small adjustment to that. If you are using our Google group, then you should definitly keep on reading.

Read more...

The governance of Nancy has been expanded

On the Nov 20, Nancy will be celebrating her 4th birthday. That is quite an achivement for any open-source project, even more so for a project in the .NET ecosystem.

During these four years a lot has happened, but apart from when Steven was added as a core contributor back on Mar 31, 2011, no one else has been granted permission to commit code to the main repository.

That is, until now.

Read more...

Community maintained Nancy F# templates for Visual Studio

Not too long ago, I posted about the Visual Studio templates for Nancy and how we had taken the (tough) decision to only maintain C# templates outselves. Not because we do not see value in supporting other languages, but solely because of the shear amount of work that is required to maintain a single template.

Maintaining 9 templates (as we do with out C# templates) is a time consuming process, and the time required to support additional templates scales linear to the amount of templates we add.

We reached out the authors of the VB.NET templates and F# templates, as well as our community, and ask them to maintain the templates themselves. I didn't take long for the F# community to step up

Read more...