Thanks to MVC route controllers, we can refactor such websites and reduce the amount of .aspx files.

All we need to do is create a method to add the route from each page to a proxy page for the front controller. The key here is pass the page as a data token so that, when frontcontroller.aspx is executed, it knows about the specific page requested.

This technique is a good middleground along the road to refactoring the whole website to MVC Controllers. It provides a clean website directory and makes it easier to change the behaviour of the front controller across all pages.

Imagine the maitre d' at a restaurant. When a diner enters the restaurant the maitre d' has to
perform a number of checks to determine whether the diner is allowed a table. When we take
this real world scenario and convert it into code, we end up writing a validation function.

This code uses the principle of returning once. Although some programmers are productive results adhering to this rule, I would rewrite this function to have multiple return statements, to fail early and fail fast.

Here is a rewritten validation method with multiple return statements:

One great way of using immutable structs is to fill existing result rows with additional information. This code iterates over a result enumerable and keys into an existing dictionary to fill it with more information: