Code52/Ideastrike — pull request #35 by csainty (2012-01-21 22:20:24+00:00)
Title: Bug fix for DataContext lifetime

Previously the DataContext was singleton over the entire lifetime of the application, and shared between requests. This would cause all sorts of trouble in production.

Switched to making it (and the repositories) scoped to the request.

The way the test bootstrapper was dealing with it's mocks had to change slightly as well. Creates new sets for each request, which is probably better anyway.
You could possibly keep it a single set in the testing by overriding the request behaviour in the main bootstrapper, but at that point why bother even subclassing it.