예제 #1
0
    internal static HttpConfiguration GetInitialIntegrationTestConfig(IContainer container)
    {
        var config = GetInitialIntegrationTestConfig();

        AutofacWebAPI.Initialize(config, container);
        return(config);
    }
예제 #2
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var config = GlobalConfiguration.Configuration;

            AutofacWebAPI.Initialize(config);

            //config.Routes.MapHttpRoute(
            //    "CustomerOrdersHttpRoute",
            //    "api/customers/{customerKey}/orders/{key}",
            //    new { controller = "CustomerOrders", key = RouteParameter.Optional }
            //);

            config.Routes.MapHttpRoute(
                name: "CustomerOrdersHttpRoute",
                routeTemplate: "api/customers/{customerKey}/orders/{key}",
                defaults: new { controller = "CustomerOrders", key = RouteParameter.Optional },
                constraints: null,
                handler: new CustomerOrdersDispatcher(config)
                );

            config.Routes.MapHttpRoute(
                "DefaultHttpRoute",
                "api/{controller}/{id}",
                new { id = RouteParameter.Optional }
                );

            config.MessageHandlers.Add(new MyShopAuthHandler());
        }
예제 #3
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var config = GlobalConfiguration.Configuration;

            RouteConfig.RegisterRoutes(config);
            WebAPIConfig.Configure(config);
            AutofacWebAPI.Initialize(config);
        }
예제 #4
0
        protected void Application_Start()
        {
            var config = GlobalConfiguration.Configuration;

            RouteConfig.RegisterRoutes(config);
            WepApiConfig.Configure(config);
            AutofacWebAPI.Initialize(config);
            EFConfig.Initialize();
        }