The most correct way would be to create a class that inherits ActionFilterAttribute and override OnActionExecuting
method. This can then be registered in the GlobalFilters
in Global.asax.cs
Of course, this will only intercept requests that actually have a route.