I need routes to match sometimes controllers, and sometimes - database values. Here's an example:

/controller/action?id=test - this is the default {controller}/{action} route

/name/type?flag=test - this is my custom {dbvalue}/{dbvalue} route

As you can see, the two routes are the same. But if {controller} or {action} is a specific value (only known at runtime because it depends on DB) - I need the route to match my other route (i.e. /specificcontroller/handleall(string name, string type) action).

Is it possible?