-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Let's say I want to transfer ownership of an IDisposable to another class by injecting the instance. This raises IDISP007 warning (don't dispose injected). However in some designs it makes sense to transfer ownership. For example the design of ZipArchive(Stream, ZipArchiveMode, Boolean, Encoding)
, which takes a stream and will (optionally) take ownership over that stream.
Now I could sprinkle my code with [SuppressMessage]
, but that feels like a workaround. Is there a good way to communicate the transferring of ownership?
JohanLarsson, sunsided, AraHaan and CSharpFiasco
Metadata
Metadata
Assignees
Labels
No labels