首页新闻找找看学习计划

ninject httpcontext mvc 4.0 注入

0
悬赏园豆:10 [待解决问题]

如题

如果注入。。

        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            //var http = HttpContext.Current;

            //var aa = new HttpContextWrapper(HttpContext.Current) as HttpContextBase;


            //kernel.Bind<HttpContext>().ToMethod(ctx => HttpContext.Current).InTransientScope();
            //kernel.Bind<HttpContextBase>().ToMethod(ctx => new HttpContextWrapper(HttpContext.Current)).InTransientScope();

            kernel.Bind<IProductService>().To<ProductService>();
        }
一强悍的抽屉一的主页 一强悍的抽屉一 | 初学一级 | 园豆:93
提问于:2013-01-15 09:36
< >
分享
所有回答(1)
0

不太明白 ...

Qlin | 园豆:2403 (老鸟四级) | 2013-01-15 10:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册