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

        AutofacWebAPI.Initialize(config, container);
        return(config);
    }
        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);
        }
        protected void Application_Start()
        {
            var config = GlobalConfiguration.Configuration;

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