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
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
The Linq to Sql data context is designed to be used for a single unit of work.
Edit: to add references.
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.