.NET & C# ยท C#
How would you handle an interview scenario involving IDisposable and resource cleanup?
When opening a stream inside a method, place it in a using scope so it is disposed even if processing fails.
When opening a stream inside a method, place it in a using scope so it is disposed even if processing fails.