title: How to structure controller to sort multiple criteria asp.net mvc
body: <p>What's the best way to set up a controller to sort by many (possibly null) criteria? Say for example, I was building a site that sold cars.  My CarController has a function Index() which returns an IList of cars to the view, and details on each car are rendered with a partial view.  </p>
  
  <p>What's the best way to structure this?  Especially if there are a lot of criteria: Car Type (aka SUV), Car Brand, Car Model, Car Year, Car Price, Car Color, bool IsNew, or if I want to sort by closest to me etc...  I'm using NHibernate as my ORM.  Should I have just a ton of possible NHibernate queries and figure out which one to choose based on if/then's in the controller? Or is there a simpler way.</p>
  
  <p>Thanks so much for the help.</p>