Lifetime of a LINQ to SQL DataContext

One of the frequently asked questions is about the lifetime of a DataContext. Should it be a long-lived, application-scoped object or should it be a short-lived, request-scoped object? Let’s get to the answer by considering the key parameters: DataContext is ideally suited for a “unit of work” approach: Retrieve a bunch of objects through one…

11