尝试访问dbcontext时获取httpContext是null错误

Geo*_*ove 6 structuremap httpcontext dbcontext

我们有一个MVC 4项目,并使用Structure Map作为IoC框架.当我们对使用DbContext的服务类进行异步调用时,它会抛出异常:

Value cannot be null.
Parameter name: httpContext

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: httpContext
Run Code Online (Sandbox Code Playgroud)

一旦抛出这个:

The operation cannot be completed because the DbContext has been disposed.
Run Code Online (Sandbox Code Playgroud)

我怎么能纠正这个?