Why is it possible to enumerate a LinqToSql query after calling Dispose() on the DataContext?
- by DanM
I'm using the Repository Pattern with some LinqToSql objects. My repository objects all implement IDisposable, and the Dispose() method does only thing--calls Dispose() on the DataContext. Whenever I use a repository, I wrap it in a using person, like this:
public IEnumerable<Person> SelectPersons()
{
using (var repository =…