Beispiel #1
0
        /// <summary>
        /// The application_ start.
        /// </summary>
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //实现自定义的依赖注入控制器
            var container = IocManager.Instance.GetContainer();
            var factory   = new UnityControllerFactory(container);

            ControllerBuilder.Current.SetControllerFactory(factory);

            // api 依赖注入
            var depentdeencyrFactory = new UnityControllerApiFactory(container);

            GlobalConfiguration.Configuration.DependencyResolver = depentdeencyrFactory;

            // 运行应用程序初始化操作
            AppInit.Run();
            ToolkitsHelper.InitAllFunc();

            // 启用EF性能调试工具
            HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize();

            // 启用Log4Net 日志
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(Server.MapPath("~" + @"/config/Log4Net.config")));
        }
Beispiel #2
0
        public App()
        {
            InitializeComponent();
#if DEBUG
            HotReloader.Current.Start(this, 8001);
#endif
            AppInit.Run(this);
            //MainPage = new NavigationPage()
        }
Beispiel #3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            AppInit.Run();
        }