Castle.Windsor and HttpContextWrapper

前端 未结 3 635
一整个雨季
一整个雨季 2021-01-16 02:16

HttpContextWrapper and HttpContextBase, as explained here, were introduced to make HttpContext more mockable/testable.

I\'m trying to use it with S#arp Architecture,

3条回答
  •  轮回少年
    2021-01-16 02:34

    My MVC Controllers are set up to accept an HttpContextBase argument in the constructor

    You gotta be doing something extremely wrong here, so stop before it's too late and damage has been caused (material, moral and human casualties :-)). You already have the HttpContext inside the controller.

    Don't register any HttpContexts in your DI framework. The HttpContext handling is the job of ASP.NET.

提交回复
热议问题