Nancy vs ASP.NET MVC - An introduction

This is the first in a series of blog posts where I take a practical approach to comparing Nancy and ASP.NET MVC.

The goal is not to say whether one framework is better than the other. Instead I will cover a number of concepts/tasks in both frameworks so that you may then draw your own conclusion.

I've used ASP.NET MVC since the first official release back in 2009. For me it was a breath of fresh air (from web forms) and was my first experience of the MVC design pattern. Since then Microsoft have continued to improve ASP.NET MVC and I've used it on a wide range of projects.

My experience with Nancy on the other hand is pretty limited. However, what I have seen of it has been very impressive and it certainly lives up to its "super-duper-happy-path" ethos.

So why not stick with ASP.NET MVC?

Hopefully as you'll come to see in this series of blog posts there is no reason why you have to stick to any one framework. Choose the right tool for the job and ultimately the one that makes you happy.

Some of the concepts I intend to cover (not necessarily in this order):

  • Getting started - from File > New Project
  • Static Resources
  • Routing
  • Rendering HTML (Views/View Engines)
  • Model Binding
  • Dependency Injection / Inversion of Control
  • Session-per-request with RavenDB/NHibernate
  • Theming support
  • Embedded Views
  • Multi-tenancy
  • Asset Optimization
  • Creating HTTP APIs
  • Authentication
  • Validation

Since I've already achieved all of the above in ASP.NET MVC I'm excited to see how we can do the same with Nancy.

Stay tuned!


Ben Foster

About Me

I'm a software engineer and aspiring entrepreneur with 12+ years experience in the tech industry and have worked with startups and SMB’s in areas such as healthcare, recruitment and e-commerce (I even worked in enterprise, once). I founded my first startup Fabrik in 2011.

I now head up the engineering team at Checkout.com. If you're interested in working in an exciting fin-tech company, drop me a message on Twitter.

Creative Commons Licence