Bigyan Rajbhandari

All about technology...

(Follow Up) Best practice and effective use of DataContext in LINQ

NOTE: 3/24/2008 - The problem of working with LINQ to sql extends beyond lifetime management of DataContext, thus I am scrapping the second part of my blog. Only thing useful in this post is the performance comparision. Here's new post on LINQ to SQL

In my previous post, I had probed a question on how to effectively incorporate DataContext in ones pattern so the ease of use and unit of work is well represented. Thanks to everyone who provided feedback, it definitely was a good read and provided lots of insight. Few reasons we got into asking this question instead of using simple create/dispose model, in the first place was

  • We wanted to make it so that it was easy to use
  • We heavily use Repository Pattern for business logic/transaction scoping and Entity model for CRUD operations, so wanted to make sure datacontext we used was as efficient as possible.
  • Concerns regarding efficiency of creating/disposing datacontext and not being able to use caching of datacontext effectively.

 

 Click here to read more...

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)