You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
In my opinion, this is something that should be provided by .net core itself, so I did a proposal here, but did not get any reply yet: dotnet/runtime#29631
In the absence of reply of the dotnet folks, we will be forced to implement our own in this project
Please join the discussion here: #130
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?The text was updated successfully, but these errors were encountered: