LINQ to SQL has no mechanism for this, but you can create a transaction with a certain level of isolation. Take a look at the code below:
using (var con = new SqlConnection("constr")) { con.Open(); using (var transaction = con.BeginTransaction( IsolationLevel.ReadUncommitted)) { using (var context = new SchoolDataContext(con)) {
Using this type of insulation is sometimes useful, that is, for performance reasons. But please do not do any create, update, or delete (CUD) operations using this type of database isolation. This, of course, depends on your situations, but your data may be in an inconsistent state.
Steven Feb 08 '10 at 10:38 2010-02-08 10:38
source share