Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 04, 2012 03:24 PM by yyie
Jun 04, 2012 03:24 PM|LINK
Hi, I have an MVC 3 application implemented with Unity that disposes the context after each http request. I want to trigger some time consuming tasks using Task.Factory.StartNew. However when my asynchronous task is executed I receive this error: "The
operation cannot be completed because the DbContext has been disposed.". It's clear for me what is happening but I don't know how to create a new dbcontext for my time consuming task.
The pice of my code that calls the time consuming task is: