Is it possible to force the use of “using” for disposable classes?
The fact that you need to ensure that the object is disposed indicates a design flaw. It’s fine if disposing is the polite or efficient thing to do, but it should not be semantically necessary. There is no way to enforce that an object is disposed of via the using statement. However, what you can … Read more