How to get RouteCollection from a request in ASP.NET MVC 4

asp.net-mvc, c#, url-routing

Solution

`RouteTable.Routes.GetRouteData(HttpContextBase)`

Problem

This is my global.asax (Registering the route) ``` routes.MapRoute("NewDatabase", "Server/{serverId}/Instances/{instanceId}/NewDatabase/", new { controller = "Server", action = "NewDatabase" } ); routes.MapRoute( "Instance", "Server/{id}/Instances/{instanceId}/Databases", new { controller = "Server", action = "Databases", id = "id",instanceId="instanceId" } ); routes.MapRoute( "Database", "Server/{id}/Instances", new { controller = "Server", action = "Instances", id = "id" } ); ``` If `xyz.com/Server/12/Instance/1/NewDatabase` will be the reuested URL to server, `Server/{serverId}/Instances/{instanceId}/NewDatabase/` will be the matching pattern. How can I know which entry is matched for the above request ? Thanks

Original source