I have a JSON structure something like this:
{
Id: 1
Data: [
{
X: 1,
Content: [...]
},
{
X: 2,
Content: [...]
},
]
}
Where Content can be very large byte arrays. The problem I have is that serialising and deserializing this structure using JSON.NET takes ups a large amount of memory on the LOH.
Is there some way I can WebAPI to stream the byte arrays to files?
The only other solution I can see is abandon JSON and use multipart/form-data but this seems kind of ugly, or is there some other way?