Well, if you need to return IDisposable
object outside of the scope where it is created, you can do so, provided that some other code somewhere calls .Dispose()
on it once it is no longer used.
However, for a more complete answer, you should post some code. A refactor may be possible to help avoid the issue altogether.