i have function:
protected void application_start() { database.setinitializer(new persondbinitializer()); globalconfiguration.configure(webapiconfig.register); routeconfig.registerroutes(routetable.routes); }
the webapiconfig is:
public static class webapiconfig { public static void register(httpconfiguration config) { // web api configuration , services // web api routes config.maphttpattributeroutes(); config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); } }
at point in code want loop through register api routes. idea how can it?
system.web.http.globalconfiguration
static , can routes with
globalconfiguration.configuration.routes foreach (system.web.http.routing.ihttproute route in globalconfiguration.configuration.routes) { }
Comments
Post a Comment