Exemplo n.º 1
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            //autofac初始化
            AutofacHelper.Init();
        }
Exemplo n.º 2
0
 /// <summary>
 /// build回调
 /// </summary>
 /// <param name="builder"></param>
 private static void buildCallback(ContainerBuilder builder)
 {
     builder.RegisterBuildCallback(container =>
     {
         //初始化Autofac容器
         AutofacHelper.Init(container);
     });
 }
Exemplo n.º 3
0
        protected void Application_Start()
        {
            //注册路由
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //Autofac初始化
            AutofacHelper.Init();

            //未处理异常
            GlobalFilters.Filters.Add(new GlobalHandleErrorAttribute());
        }