我正在使用带有自助服务的 LLBLGen Pro 2.5。如果我想在事务中将一些行添加到我的表中,然后更新我添加的第一行,我是否必须再次将第一个实体添加到事务对象中?
这是我的意思的一个虚构示例:
Dim objCustomer as New CustomerEntity()
Dim trans as new Transaction(IsolationLevel.ReadCommitted, "AddRecord")
objCustomer.FirstName = "John"
objCustomer.LastName = "Locke"
objCustomer.DateCreated = DateTime.Now
trans.Add(objCustomer)
objCustomer.Save()
Dim objOrder as New OrderEntity()
objOrder.CustomerID = objCustomer.CustomerID
objOrder.OrderDate = DateTime.Now
trans.Add(objOrder)
objOrder.Save()
objCustomer.FirstOrderID = objOrder.OrderID
trans.Add(objCustomer) 'DO I DO THIS??????
objCustomer.Save()
trans.Commit()
任何建议将不胜感激!