Is it possible to enforce the use of a using statement in C#

后端 未结 3 1353
野趣味
野趣味 2021-01-18 10:39

Would really like to be able to decorate my class with an attribute of some sort that would enforce the use of a using statement so that the class will always be safely disp

3条回答
  •  庸人自扰
    2021-01-18 11:15

    You could use FxCop to enforce this rule. See the Wikipedia for a quick overview.

提交回复
热议问题