In the following scenario I want to return just a string because that's what the spec says but to do that I have to return a stream and I just want to make sure than I don't keep too many streams around for too long. The method looks like:
[WebGet(BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
UriTemplate = "someuri/{parameter}")]
[OperationContract]
public Stream FooBar(string parameter)
{
byte[] bytes = Encoding.UTF8.GetBytes("some string");
return new MemoryStream(bytes);
}
Does anyone know when this resource is released?