我发现几乎每个类(Controller、View、HTML帮助程序、服务等)我都需要当前登录的用户数据。所以我考虑创建一个“环境上下文”而不是直接注入(inject)IUserService或用户。我的方法看起来像那样。publicclassBootstrapper{publicvoidBoot(){varcontainer=newContainer();//thecalltoIUserService.GetUseriscachedperHttprequest//byusingadynamicproxycachingmechanism,thatalsohandlescaseswhere