I\'m playing with protobuf-net and WCF. Here is code I created:
public class MobileServiceV2
{
[WebGet(UriTemplate = \"/some-data\")]
[Description(\"
Just write to a MemoryStream, and rewind it. Do not Dispose() it in this case:
var ms = new MemoryStream();
Serializer.Serialize(ms, obj);
ms.Position = 0;
return ms;
This does, however, mean that it buffers in memory. I could try and come up with some voodoo to avoid that, but it would be very complex.