Ejemplo n.º 1
0
 /// <summary>
 /// 初始化WebApi框架
 /// </summary>
 public static IAppBuilder UseWebApiInitialize(this IAppBuilder app, WebApiInitializeOptions options)
 {
     app.CheckNotNull("app");
     options.CheckNotNull("options");
     IFrameworkInitializer initializer = new WebApiFrameworkInitializer(options);
     initializer.Initialize();
     return app;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化WebApi框架
        /// </summary>
        public static IAppBuilder UseWebApiInitialize(this IAppBuilder app, WebApiInitializeOptions options)
        {
            app.CheckNotNull("app");
            options.CheckNotNull("options");
            IFrameworkInitializer initializer = new WebApiFrameworkInitializer(options);

            initializer.Initialize();
            return(app);
        }
Ejemplo n.º 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="WebApiFrameworkInitializer"/>类型的新实例
 /// </summary>
 public WebApiFrameworkInitializer(WebApiInitializeOptions options)
     : base(options)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 初始化一个<see cref="WebApiFrameworkInitializer"/>类型的新实例
 /// </summary>
 public WebApiFrameworkInitializer(WebApiInitializeOptions options)
     : base(options)
 {
 }