There's nothing wrong with HttpWebRoute when you call MapHttpRoute. The scenario I'm talking about is the following:<br /><br />1. You want to customize GetRouteData and GetVirtualPath, so you create a specialized IHttpRoute, eg. MyHttpRoute<br />2. You add MyHttpRoute to GlobalConfiguration.Configuration.Routes, which adds a HttpWebRoute that wraps MyHttpRoute to RouteTable.Routes<br />3. Calls to HttpWebRoute.GetRouteData or HttpWebRoute.GetVirtualPath do not call the same method on the wrapped MyHttpRoute, so the custom behaviour is not executed<br /><br />Of course, this should be the case only when HttpWebRoute wraps an instance that is not HostedHttpRoute, because HostedHttpRoute wraps HttpWebRoute, which would result in an infinite loop.<br /><br />HttpWebRoute should be an adapter for MyHttpRoute, just like HostedHttpRoute is an adapter for HttpWebRoute.<br /><br />Makes sense?
↧