Nếu bạn có somehting như thế này:giao dịch lồng nhau với TransactionScope
IBinaryAssetStructureRepository rep = new BinaryAssetStructureRepository();
var userDto = new UserDto { id = 3345 };
var dto = new BinaryAssetBranchNodeDto("name", userDto, userDto);
using (var scope1 = new TransactionScope())
{
using(var scope2 = new TransactionScope())
{
//Persist to database
rep.CreateRoot(dto, 1, false);
scope2.Complete();
}
scope1.Dispose();
}
dto = rep.GetByKey(dto.id, -1, false);
Liệu TransactionScope scope2 bên trong cũng được cuộn lại?
Liên kết này bị hỏng. – adamjford
Bạn nói scope.Dispose là dư thừa, nhưng quan trọng hơn scope1.dispose cuộn trở lại giao dịch. – Mcanic