not use "using" statement for TransactionScope

Posted by hotyi on Stack Overflow See other posts from Stack Overflow or by hotyi
Published on 2010-05-07T09:09:22Z Indexed on 2010/05/07 9:18 UTC
Read the original article Hit count: 235

Filed under:

i always using the following format to use transactionscope.

using(TransactionScope scope = new TransactionScope()){
  ....
}

sometimes i want to wrap the transactionscope to a new class, for example DbContext class, i want to using the statement like

dbContext.Begin();
...
dbContext.Submit();

it seems the transactioncope class need use "using"statement to do dispose, i want to know if there is anyway not use "using".

© Stack Overflow or respective owner

Related posts about c#