views:

471

answers:

1

From your experience, is LINQ to SQL appropriate as a Unit of Work? is it avoidable? should I prefer, say, NHibernate or another O/RM tool?

Thanks, Lucian

+2  A: 

The Linq to Sql data context is designed to be used for a single unit of work.

Edit: to add references.

The Linq To SQL FAQ:

Q: Should I create a new DataContext in every business logic method?

A: The DataContext conforms to the Unit of Work design pattern. Unless you are moving data between physical tiers between each operation you should keep your DataContext alive for the duration of work.

DaRKoN_
Some links, if possible, please?
lmsasu
added references
DaRKoN_