March 31, 2013

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!

© 2022 Ben Foster