what does a using statement without variable do when disposing?

前端 未结 4 843
感动是毒
感动是毒 2020-12-17 09:01

I\'ve always used using with variable and assignment. Now i have like this a class DbProviderConnection:

public class DbProviderConnection : IDisposable
{
           


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-17 09:23

    The object that BeginTransaction returns, is what will be disposed.

    BeginTransaction returns a DbTransaction so that is what will be disposed

提交回复
热议问题