Detecting a Dispose() from an exception inside using block

前端 未结 8 518
暖寄归人
暖寄归人 2021-02-01 19:13

I have the following code in my application:

using (var database = new Database()) {
    var poll = // Some database query code.

    foreach (Question question          


        
8条回答
  •  广开言路
    2021-02-01 19:28

    Sound like you need TransactionScope http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx

提交回复
热议问题