I have multiple multiple updates to perform in a transactions and some of them are for related entities (i.e. Order - OrderDetail). Do I have to explicitly add all the related entities in the transaction or I can simply add the top entity (i.e Order) and call Save(true) and it will automatically add linked objects in the same transaction?
Using the example from help will these operations run in the same transaction?
Transaction transactionManager = new Transaction(IsolationLevel.ReadCommitted, "Test");
try
{
OrderEntity newOrder = new OrderEntity();
....
OrderDetailsEntity newOrderRow = new OrderDetailsEntity();
newOrderRow.Order = newOrder;
.....
OtherNonRelatedEntity otherEntity = new OtherNonRelatedEntity();
otherEntity.... change
transactionManager.Add(newOrder );
transactionManager.Add(otherEntity );
newOrder.Save(true);
otherEntity.Save();
transactionManager.Commit();
}
...