WebApi 2.0 Configuration
Opened this issue · 0 comments
devmondo commented
Hi, i have just started a project with MVC 5.0 and i have WebApi controllers in imported assemblies, before we used to do this to register them with Attribute Routing
GlobalConfiguration.Configuration.Routes.MapHttpAttributeRoutes(config =>
{
config.AddRoutesFromAssemblyOf<ImportedLibrary>();
config.AddDefaultRouteConstraint(@"[Ii]d$", new RegexRouteConstraint(@"^\d+$"));
config.UseRouteHandler(() => new HttpCultureAwareRoutingHandler());
config.AddTranslationProvider(translationProvider);
config.UseLowercaseRoutes = true;
config.InheritActionsFromBaseController = true;
config.AutoGenerateRouteNames = true;
});
but now i cant, the only thing available now is
GlobalConfiguration.Configuration.MapHttpAttributeRoutes();
i want this as i have mentioned so i can register Routes in Controllers in imported Assemblies, plus i want to use RoutePrefix, so what i do is in Imported Library i create base WebApiController and add the Route Prefix to it and then in main Application i inherit from it in all controllers so i wont repeat myself.
thanks in advanced.