I'm doing
using(var scope = new TransactionScope())
{
//lots of calls to sql server
scope.Complete();
}
and it works like a transaction
I would like to know if it is goi开发者_如何学运维ng to work the same with postgres ?
TransactionScope
eventually result in creation of concrete transaction object. In case of MS SQL it is SqlTransaction, in case of postgres it might be NpgsqlTransaction or whatever you are using. So if you doubt, you always can create transaction explicitly and be sure.
精彩评论