Guest User

Untitled

a guest
Dec 13th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.18 KB | None | 0 0
  1. using (var a = new DisposableObject())
  2. {
  3.     return a.Method();
  4. }
  5.  
  6. // is the same as
  7.  
  8. var a = new DisposableObject();
  9.  
  10. try
  11. {
  12.     return a.Method();
  13. }
  14. finally
  15. {
  16.     a.Dispose();
  17. }
Add Comment
Please, Sign In to add comment