I have read many webpages, it is recommended that if you use multiple connections, you should use TransactionScope, but if you have a unit that performs multiple operations, the connection should be treated as an atomic unit of work, then it should Do you use TransactionScope?
I found the following quote: “I suggest you Use the TransactionScope class to create implicit transactions on this website”: http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx.TransacrtionScope Has the SQLTransaction class replaced? That is, should all new applications/transaction functions use the TransactionScope class? If this is the case, then I assume that SQLTransaction is there so that the legacy application does not need to be changed?
I have read many webpages, it is recommended that if you use multiple connections, you should use TransactionScope, but if you have a unit that performs multiple operations, the connection should be treated as an atomic unit of work, then it should Do you use TransactionScope?
I personally like transactionScope, because your query to the database does not require sqlTransaction (or connection) or other related code parameters to maintain the transaction. This usually allows you The service/business layer completely manages the affairs, which is just cleaner for me.