Scope Conservation Statement in C #

Resource Initialization (RAII) idioms and try-finally statements form the basis of traditional approaches to writing safe programming exceptions .

My question is: is there something like a Scope Guard Statement in C #?

+4
source share
1 answer

There is no direct translation of the framework guard idioms embedded in C # or in BCL, but Alex Ronne Petersen wrote a blog post with a solution that uses the IDispoable interface and C # using statements to do something similar to what you are looking for.

+4
source

All Articles