Example #1
0
 /// <summary>
 /// 初始化Mvc框架
 /// </summary>
 public static IAppBuilder UseMvcInitialize(this IAppBuilder app, MvcInitializeOptions options)
 {
     options.CheckNotNull("options");
     IFrameworkInitializer initializer = new MvcFrameworkInitializer(options);
     initializer.Initialize();
     return app;
 }
        /// <summary>
        /// 初始化Mvc框架
        /// </summary>
        public static IAppBuilder UseMvcInitialize(this IAppBuilder app, MvcInitializeOptions options)
        {
            options.CheckNotNull("options");
            IFrameworkInitializer initializer = new MvcFrameworkInitializer(options);

            initializer.Initialize();
            return(app);
        }
Example #3
0
        private static void Initialize()
        {
            ICacheProvider provider = new RuntimeMemoryCacheProvider();
            CacheManager.SetProvider(provider, CacheLevel.First);

            IBasicLoggingInitializer loggingInitializer = new Log4NetLoggingInitializer();
            //Mvc初始化
            MvcInitializeOptions mvcOptions = new MvcInitializeOptions(loggingInitializer, new MvcAutofacIocInitializer());
            IFrameworkInitializer initializer = new MvcFrameworkInitializer(mvcOptions);
            initializer.Initialize();

            //WebApi初始化
            WebApiInitializeOptions apiOptions = new WebApiInitializeOptions(loggingInitializer, new WebApiAutofacIocInitializer());
            initializer = new WebApiFrameworkInitializer(apiOptions);
            initializer.Initialize();

            ////SignalR初始化
            //SignalRInitializeOptions signalrOptions = new SignalRInitializeOptions(loggingInitializer, new SignalRAutofacIocInitializer());
            //initializer = new SignalRFrameworkInitializer(signalrOptions);
            //initializer.Initialize();
        }
 /// <summary>
 /// 初始化一个<see cref="MvcFrameworkInitializer"/>类型的新实例
 /// </summary>
 public MvcFrameworkInitializer(MvcInitializeOptions options)
     : base(options)
 {
 }
 /// <summary>
 /// 初始化一个<see cref="MvcFrameworkInitializer"/>类型的新实例
 /// </summary>
 public MvcFrameworkInitializer(MvcInitializeOptions options)
     : base(options)
 {
 }