It seems popular at the moment if you implement the repository as simple
IQueryable<T> FetchAll<T>();
using LINQ to SQL, then the repository should set the DataContext, which remains available outside the repository.
So my question is: how does a DataContext get Disposed? What if an exception is thrown by code outside the repository? Will it be a database connection leak?
thanks
source
share