如题
如果注入。。
/// <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>(); }
不太明白 ...