我想在任何mvc路由之前注册一个服务路由。在mvc应用程序中注册ServiceRoute?
有没有像product/296eb068-2a1a-439a-b608-6dc0da49cb36
var factory = new DataServiceHostFactory();
var serviceRoute = new ServiceRoute("product/{*guid only}", factory,
typeof(ProductService));
serviceRoute.Defaults = new RouteValueDictionary { { "serviceType", "odata" }};
serviceRoute.Constraints = new RouteValueDictionary { { "serviceType", "odata"}};
routes.Add("myproduct", serviceRoute);
我知道{*guid only}
工作不注册它的方式。有没有办法让它成为一个正则表达式约束?