public struct S : IDisposable { private bool dispose; public void Dispose() { dispose = true; } public bool GetDispose() { return dispose; } } In the example below you will see: false false
var s = new S(); using (s) { Console.WriteLine(s.GetDispose()); } Console.WriteLine(s.GetDispose()); Why did the second time false , because Dispose() called? Thank.
disposewasdisposeto true - Ivan IvanovIDisposablefor a structure is a bad idea. Why not use the class? - VladD