Skip to content

Glossary: C# Beyond the Basics

using declaration

Also written: using statement, using var

`using var x = ...;` calls `Dispose` on `x` when it goes out of scope, even after an exception. The `using` statement does the same at the end of its braces.

Where the book teaches it

Related terms

IDisposableawait usingstream