LINQ in Action roller

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 or more queries, make changes to the resulting object graph based on user input (databound to controls) or some other request and then call SubmitChanges(). Read More...
Published Sunday, April 27, 2008 9:51 PM by Dinesh's Cyberstation
Filed under: ,
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication