Skip to main content

You could also use a DynamicProxyDynamicProxy to extend the Dispose()Dispose() method. thisThis way you could do something like:

using (var wrapperdProxy = new Proxy()) { // Do whatever and dispose of Proxy will be called and work properly. }

using (var wrapperdProxy = new Proxy<yourProxy>()) { // Do whatever and dispose of Proxy<yourProxy> will be called and work properly. } 

You could also use a DynamicProxy to extend the Dispose() method. this way you could do something like:

using (var wrapperdProxy = new Proxy()) { // Do whatever and dispose of Proxy will be called and work properly. }

You could also use a DynamicProxy to extend the Dispose() method. This way you could do something like:

using (var wrapperdProxy = new Proxy<yourProxy>()) { // Do whatever and dispose of Proxy<yourProxy> will be called and work properly. } 
Source Link
Uri Abramson
  • 6.2k
  • 6
  • 44
  • 65

You could also use a DynamicProxy to extend the Dispose() method. this way you could do something like:

using (var wrapperdProxy = new Proxy()) { // Do whatever and dispose of Proxy will be called and work properly. }