I’d recommend avoiding the singleton where ever possible and instead resolve the HttpContext from:
var httpCtx = ((AspNetRequest)Request).HttpRequest.ToHttpContextBase();
In v6.3 (now released) this is available from:
var httpCtx = Request.ToHttpContextBase();
You’ll need to either change IService
to Service
or have your Service implement IRequiresRequest
so the Request
can be injected into your Service.