Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to use Linq2Sql? [closed]

I'm struggling to think of a good way to use linq2sql, simply I want to use it, but I can't figure out whether it's best to wrap up the linq2sql generated classes inside my model classes providing some form of generic abstract base class / or interface for the common methods on my model classes like add, update, delete etc, or to extend the partial classes that linq2sql generated.

What design have people found most successful? and could you give a quick run down of those said designs?

(I know this is kind of subjective because everyone will have their own best ways, however , I'm not sure if it should be tagged as so. Feel free to edit and make a community wiki if you think it should be.)

like image 422
Sekhat Avatar asked Dec 23 '22 13:12

Sekhat


1 Answers

Personally, I wrap Linq2SQL in the repository pattern.

like image 68
MrJavaGuy Avatar answered Dec 27 '22 10:12

MrJavaGuy