Returning Azure BLOB from WCF service as a Stream - Do we need to close it?

后端 未结 2 1748
清歌不尽
清歌不尽 2021-01-26 09:54

I have a simple WCF service that exposes a REST endpoint, and fetches files from a BLOB container. The service returns the file as a stream. i stumbled this post about closing t

2条回答
  •  抹茶落季
    2021-01-26 10:17

    OperationBehaviorAttribute.AutoDisposeParameters is set to TRUE by default which calls dispose on all the inputs/outputs that are disposable. So everything just works.
    This link :
    http://devdump.wordpress.com/2008/12/07/disposing-return-values/
    explains how to manually control the process.

提交回复
热议问题