We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a048f67 commit ada6a9eCopy full SHA for ada6a9e
1 file changed
documentation/IDISP011.md
@@ -15,11 +15,26 @@ Don't return disposed instance.
15
16
## Motivation
17
18
-ADD MOTIVATION HERE
+In the below example the `FileStream` is disposed and not usable
19
+
20
+```cs
21
+public FileStream M(string fileName)
22
+{
23
+ using var stream = File.OpenRead(fileName);
24
+ return stream;
25
+}
26
+```
27
28
## How to fix violations
29
-ADD HOW TO FIX VIOLATIONS HERE
30
+Don't dispose an instance that is returned. Caller is responsible for disposing.
31
32
33
34
35
+ return File.OpenRead(fileName);
36
37
38
39
<!-- start generated config severity -->
40
## Configure severity
0 commit comments