Direct routes reordering and searching for first match only

Topics: ASP.NET MVC
Mar 4, 2015 at 9:35 AM
Hi!
I'm working on a website constructor, which routing system differs from standart static routing because users can create their own pages. I was able to implement the routing system I needed, by dividing all routes into page and non-page routes. Page routes query database, where the pages and their urls are stored. Non-page routes don't do the query.
When a request to some action not connected with pages is being made, no database querying is needed. But it still happens, becase page and non-page routes, generated by MapMvcAttributeRoutes, are mixed, so that many page routes are positioned before non-page routes. Latest update brought another problem for my routing system. Before the update routing system would stop processing routes after first match is found, which is ideal for me. Now it loops through all the routes to find all the matches.
Is it possible now to implement route reordering and searching for the first match only?