Adding route at runtime

Topics: Web Api
Oct 17, 2011 at 10:22 AM

Hi

I using Windsor::Castle to dynamically load my services at runtime... however to add a route:

RouteTable.Routes.MapServiceRoute<MyService>("helloworld");

I need to know the type at compile time.... seems like there's missing a:

RouteTable.Routes.MapServiceRoute(typeof(MyService),"helloworld");

is there another way??

TIA

Søren

Oct 17, 2011 at 12:16 PM

Aha.....

Guess I can just do:

RouteTable.Routes.Add(new ServiceRoute("helloworld", new HttpServiceHostFactory(), typeof (MyService));

Søren