Sorry, I meant without having to reference the DAL. It's not a big deal, was just wondering. Your sample seems fine and I've converted it over to VB.NET and it looks good...
Dim franchiseSvc As New Services.FranchiseService
Dim transactionManager As Data.TransactionManager = Nothing
Try
Dim isBorrowedTransaction As Boolean = Services.ConnectionScope.Current.HasTransaction
transactionManager = Services.ConnectionScope.ValidateOrCreateTransaction(True)
franchiseSvc.DeepSave(oneFranchise, Data.DeepSaveType.IncludeChildren, FranchiseInfoDeepLoadTypes)
' Call the helper methods to save the junction tables for our entitiy collections that need it
SaveAddressJunctionTables(oneFranchise.FranchiseId, oneFranchise.AddressCollection_From_FranchiseAddress)
SaveContactJunctionTables(oneFranchise.FranchiseId, oneFranchise.ContactCollection_From_FranchiseContact)
'if persisted and tran not borrowed, commit
If (Not isBorrowedTransaction) AndAlso (Not transactionManager Is Nothing) AndAlso transactionManager.IsOpen Then
transactionManager.Commit()
End If
Catch ex As Exception
'if open, rollback, it's possible this is part of a larger commit
If Not transactionManager Is Nothing AndAlso transactionManager.IsOpen Then
transactionManager.Rollback()
End If
End Try