Getting httpContext is null error while trying to access dbcontext
Asked Answered
K

0

6

We have a MVC 4 project and using Structure Map as an IoC framework. When we make an async call to the service class that using DbContext it throws an exception:

Value cannot be null.
Parameter name: httpContext

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: httpContext

Once it has thrown this:

The operation cannot be completed because the DbContext has been disposed.

How can I correct this?

Knobby answered 19/11, 2012 at 14:48 Comment(1)
How are you injecting your DbContext into the container?Humid

© 2022 - 2024 — McMap. All rights reserved.