private void WriteLines(IEnumerable <string> lines) { using var file = new MyFile("test.txt"); foreach (var line in lines) { file.WriteLine(line); } myFile = file; } //is disposed
private void WriteLines(IEnumerable <string> lines) { //não precisa mais usar o using no contexto using var file = new MyFile("test.txt"); foreach (var line in lines) { file.WriteLine(line); } myFile = file; }