Friday, June 24, 2011

Invalid operation. The connection is closed. ASP.NET MVC

Invalid operation. The connection is closed. ASP.NET MVC



In Entity framework 4.0.. datacontext shouldn't be static. so then, in every controller, you need to do a new instance of datacontext.

Otherwise, static datacontext can occur that two different request hitting will break the site.

1 comment:

Eran Smith said...

It would have been better if you could explain with an example.

.net obfuscators