我正在使用一个数据库,并且有一种情况我想关闭其中的一个特性。关闭该功能看起来像这样......DatabaseContext.Advanced.UseOptimisticConcurrency=false;开启它同样简单。这功能很好。但我对某些东西很好奇,想探索它......是否可以像处理dispose和unsafe那样将其包装在“using”block中?例如……using(DatabaseContext.Advanced.UseOptimisticConcurrency=false){//dothings!}//thefeatureisturnedbackonautomatical