Sql Azure 在执行插入时是否支持使用 TransactionScope()?下面是我正在尝试做的代码片段。
using (var tx = new TransactionScope(TransactionScopeOption.RequiresNew, new TransactionOptions() { IsolationLevel = IsolationLevel.ReadCommitted }))
{
using (var db = MyDataContext.GetDataContext())
{
try
{
MyObject myObject = new MyObject()
{
SomeString = "Monday"
};
db.MyObjects.InsertOnSubmit(myObject);
db.SubmitChanges();
tx.Complete();
}
catch (Exception e)
{
}
}
}