protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AutoMapperConfig.Config(); WindsorConfig.Config(); }
public static void Register(HttpConfiguration config) { // ConfiguraciĆ³n y servicios de API web config.Services.Replace(typeof(IHttpControllerActivator), new WindsorControllerActivator(WindsorConfig.Config())); config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); config.Formatters.JsonFormatter.UseDataContractJsonSerializer = false; config.EnableCors(new EnableCorsAttribute("*", "*", "*")); // Rutas de API web config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); }